At my server, we receive Self Described Messages (as defined 
which btw wasn't all that easy as there aren't any 'good' examples of this 
in c++ but was definitely manageable). 

At this point I am having no issue creating messages from these 
self-described ones. I can take the FileDescriptorSet, go through each 
adding each to a DescriptorPool (using 
which also gives me every defined FileDescriptor).

>From here I can create any of the messages which were defined in the 
FileDescriptorSet with a DynamicMessageFactory instanced with the DP and 
 is very easy to do as our SelfDescribedMessage required the messages 
full_name() and thus we can call the 
 of the DP, giving us the properly encoded Message Prototype).

The question is how can I take each already defined Descriptor or message 
and dynamically BUILD a 'master' message that contains all of the defined 
messages as nested messages. This would primarily be used for saving the 
current state of the messages. Currently we're handling this by just 
instancing a type of each message in the server(to keep a central state 
across different programs). But when we want to 'save off' the current 
state, we're forced to stream them to disk as defined 
They're streamed one message at a time (with a size prefix). We'd like to 
have ONE message (one to rule them all) instead of the steady stream of 
separate messages. This can be used for other things once it is worked out 
(network based shared state with optimized and easy serialization) 

Since we already have the cross-linked and defined Descriptors, one would 
think there would be an easy way to build 'new' messages from those already 
defined ones. So far the solution has alluded us. We've tried creating our 
own DescriptorProto and adding new fields of the type from our already 
defined Descriptors but got lost (haven't deep dived into this one yet). 
We've also looked at possibly adding them as extensions (unknown at this 
time how to do so). Do we need to create our own 
 unknown at this time how to do so)?

Any insights? I've tried posting a question at 
 haven't had any responses. I apologize if this isn't the correct 
location to ask this question.

Thank You

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to