how to use Protobuf encode map like structure?

3,900 views
Skip to first unread message

Felix

unread,
Apr 8, 2011, 5:56:09 PM4/8/11
to Protocol Buffers
Hi all, I am having a hardtime using protobuf when there is no Map
like structures. Say I want to have something like

message MyStructs{
message MyMaps{
required int32 bucket=1;
required int32 id = 2;
required Value value =3;
}

repeated MyMaps map =1;
}

However, the bucket could be the same value for many entries, it would
save a lot of storage if I could do something like

message MyStructs{

message MyMaps{
required int32 id = 2;
required Value value =3;
}

repeated PROTOBUF_MAP<KEY, repeated MyMaps map> =1;
}

Jason Hsueh

unread,
Apr 15, 2011, 2:05:34 PM4/15/11
to Felix, Protocol Buffers
We have bandied about the idea of supporting maps for some time. Past discussion: http://groups.google.com/group/protobuf/browse_thread/thread/5b43b26dec43bf99

At the moment, you just have to build your own map structures around the protobuf.


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.


Reply all
Reply to author
Forward
0 new messages