See the techniques section on Union Types:
http://code.google.com/apis/protocolbuffers/docs/techniques.html#union
Hope this helps,
Evan
--
Evan Jones
http://evanjones.ca/
--
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.
I read the link you pointed to me, and it appears that Union Types are
not generic enough to suit my needs. Self Describing Messages seems
more like what I need, but they appears to be to heavy to use; I just
need something that takes a buffer (char[] which contains bytes of the
message) as an input and return the message type. Is there something
similar or am I trying to use protoccol buffers the wrong way?
I justneed something that takes a buffer (char[] which contains bytes of the
message) as an input and return the message type.
Ok, so, I will likely opt for Enum Types. Thanks for answering.
I think union types are the best choice for a "small" number of possible
messages. However, if you really need to support *any* type of message,
you could consider adding a "header" message of a known type that
includes the fully-qualified message name as returned by
message->GetDescriptor()->full_name(), or some other unique "message
type" indicator.
Good luck,
The problem that concerns me is that I need to have unique extension
ids. This seems difficult when using Protocol Buffers as an RPC
system, unless I'm thinking about this in the wrong way? I haven't
actually thought about this very hard.
I am trying to solve a similar problem. Can anybody point me to a
small and (hopefully) working example of this technique (union types +
extensions)?
Thanks and best regards.