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...
Yes,
repeated
means that the field is an array of the specified type.There is a list in java
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...