Protocol buffers directly process a small number of constructs; vectors are well matched with the "repeating" type of element, but as presented in C ++ through the "add" methods, you donβt (AFAIK) just pass the vector to it. See "Re-nested Message Fields" here for more information.
Re displays; there is no built-in mechanism for this, but a key / value pair is easily represented in .proto (usually the key value = 1, value = 2), and then it is processed through "reuse".
The shared_ptr itself hardly makes sense in a serialized file. But an object can be treated (presumably) as a message.
Please note that the DTO layer is generated in the Google C ++ version, so you may need to map between them and any existing object model. This is usually pretty trivial.
For some languages ββ/ platforms, there are protobuffs that work against existing object models.
(sorry, I can not comment on thrift - I am not familiar with it)
source share