Given the following:
----------------------
message MessageContainer {
optional string common_header_info = 1 [default = ""];
extensions 1000 to max;
}
message SubMessage
{
optional string mySubString = 1;
}
extend MessageContainer
{
optional SubMessage subMessage = 1001;
}
----------------------
If I have a Message* (which is actually a SubMessage), how to I set or
copy that extension into MessageContainer, without knowing that the
Message* is a SubMessage?
It looks like all extensions accessors need to use
ExtensionIdentifiers. Is the above possible?
The idea is that I'll use MessageContainer to contain one of several
messages that extend MessageContainer, but I want to have generic code
that doesn't have to know what type of Message is being dealt with.
And I want the code that deals with Messages not to have to worry
about the MessageContainer message.
Another question: is it possible to set an extension message without
making a copy of the message? I read a post about MutableExtension
being designed the way it was because object ownership is clear. But,
I'd hate to have to make a copy if it's not necessary.
Any help/feedback would be greatly appreciated.
Wade
Any help/feedback would be greatly appreciated.
Wade
--
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.