c++ - protobuf repeated 怎么用的?
怪我咯
怪我咯 2017-04-17 11:09:19
0
4
1317

是否可以用这个字段传输很多个该类型的数据?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(4)
黄舟

Yes, repeated means that the field is an array of the specified type.

Ty80

There is a list in java

Peter_Zhu

The data type of protobuf repeated is similar to C ’s Vector and list, and can only transmit the same data type. Of course, if you want to transmit multiple data types, you can use a method similar to C union, using a large message. Each field of the message is marked with optional. When you are processing the business, you can only use one field at a time. Assignment can also achieve the purpose.
In addition: repeated can only indicate whether there is data or not. When there is no data, there is ambiguity in whether to keep the original data or delete all data. Additional fields are required for processing.
http://blog.csdn.net/chenxiaohong3905/article/details/6929430
http://blog.csdn.net/chenxiaohong3905/article/details/6906459

大家讲道理

The protobuf repeated type is equivalent to the vector of std. It can be used to store N contents of the same type. I found an article to introduce the usage of protobuf repeated.
http://blog.csdn.net/mycwq/ar...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template