Groups
Groups
Sign in
Groups
Groups
Protocol Buffers
Conversations
About
Send feedback
Help
Serializing mixed type arrays with protobuf
939 views
Skip to first unread message
Flo Loferer
unread,
Feb 11, 2016, 1:43:10 PM
2/11/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
I have an array containing two different object types.
Is there a chance to serialize this array with protobuf?
What would the message definition look like?
Josh Haberman
unread,
Feb 19, 2016, 6:54:28 PM
2/19/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
If you want an array of mixed-type data, the best option in protobuf is something like this:
message Types {
oneof types {
Foo foo = 1;
Bar bar = 2;
}
}
message Container {
repeated Types list = 1;
Reply all
Reply to author
Forward
0 new messages