that's the document I was looking for.  thanks so much!


On Sep 23, 10:23 am, Kenton Varda <> wrote:
> The different accessor functions for C++ protobuf classes are documented in
> detail here:
> Message objects can be large, so you should avoid copying them if possible.
>  Instead, you should use the mutable_() accessor to get a pointer to the
> sub-message early on, and then modify that sub-message directly, rather than
> build a separate object and then copy it.  For example:
> DON'T do this:
>   Foo foo;
>   SetupFoo(&foo);
>   Bar bar;
>   bar.mutable_foo()->CopyFrom(foo);
> Do this instead:
>   Bar bar;
>   SetupFoo(bar.mutable_foo());
> This avoids copying, thus making your code more efficient.  It's also
> shorter.
> On Wed, Sep 23, 2009 at 8:13 AM, <>wrote:
> > I am having trouble accessing many members of my .proto file.  It
> > seems that compound members are not accessible with set_() method
> > calls.  I saw in your example code the use of mutable_() calls. What
> > does this apply to and is there documentation on it? could this be the
> > solution to my problem?
> > Thanks!
> > Jay
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
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