On Thu, Feb 16, 2017 at 4:27 PM, vitaly numenta <vitaly.krugl.numenta@gmail.
com> wrote:

> Hi Kenton - thank you for the insights. Regarding
>
> In Python, you could read the message with a MessageReader and then copy
>> the contents into the branch of the final message.
>
>
> So, the Python side would have a MessageBuilder. To read the branch
> message with a MessageReader in python, we would use the from_segments
> method, which would make use of the SegmentReader under the covers.
> However, I am a bit stomped how to do the last part, namely how to copy the
> contents of the MessageReader into the branch of the final message. I
> couldn't find the way to do that in both pycapnp and capnproto. How would
> you copy the contents of the MessageReader into a branch of a
> MessageBuilder in capnproto in c++?
>

Does a regular assignment work?

    parent_struct_builder.some_field = some_struct_reader

In C++, we generate a "setFoo()" method for each struct-typed field that
takes a Reader as the parameter and makes a copy.

-Kenton

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to