There is no way to do that. A message does not know what message it is 
contained inside. Pointers only go down to submessages, not up to parent 
messages.

On Friday, April 28, 2017 at 3:49:41 AM UTC-7, Peter Wang wrote:
>
> Hello,
>
> 1. message Foo's definition,
> message Foo {
>   extensions 100 to 199;
> }
>
> 2. extension message Baz's definition,
> message Baz {
>   extend Foo {
>     optional Baz foo_ext = 124;
>   }
> }
>
> 3. get the baz object's pointer by foo object use the MutableExtension() 
> API,
> Foo foo;
> Baz* baz = foo.MutableExtension(Baz::foo_ext);
> FillInMyBaz(baz);
>
> But how to get the foo object by baz?
>
> Best Regards,
> Peter
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to