[protobuf] Accessing repeated fields in extensions from C++

2013-07-08 Thread glenn . ramsey . nz
Hi, In the following protocol buffer, how does one access the repeated fields in the extension from C++? Glenn base.proto: message Base { optional int32 id = 1; repeated int32 ids = 2; optional string name = 3; repeated string names = 4; extensions 1000 to 1999; }

[protobuf] Casting of pb.h into regular header files and vice versa

2013-07-08 Thread zedan185
I currently have multiple classes in my project some of these classes use boost serialization and these classes are used at various places in the project. I now need to serialize some of these classes and send them across the network as string. For this I am using google protocol buffer. My

[protobuf] Cross-compiling on OS X

2013-07-08 Thread Liam Lacey
Hey I've managed to compile and install the protobufs lib onto my OS X 10.6 machine, and I've managed to link the libprotobuf.a file to an Xcode project which will then compile and run fine when building for 64 bit. However when trying to build the same project for 32 bit I get the following

[protobuf] Partial Decoding of message

2013-07-08 Thread ittium
Hi Group, I am using protobuf in a multi-threaded software. Here manager thread decodes the protobuf encoded message and then assign the message to a particular worker thread based on key. I want to minimize per message processing at manager thread. Is it possible to encode the key at the head

Re: [protobuf] Accessing repeated fields in extensions from C++

2013-07-08 Thread Feng Xiao
On Tue, Jul 2, 2013 at 8:10 PM, glenn.ramsey...@gmail.com wrote: Hi, In the following protocol buffer, how does one access the repeated fields in the extension from C++? Use ExtensionSize(id), GetExtension(id, index) etc. to access repeated extensions. Glenn base.proto: message Base

Re: [protobuf] Object that refers to another object of the same type

2013-07-08 Thread Ilia Mirkin
You can't really have pointers to data with protobuf, only actual data. You might do something like message Node { optional string name; repeated string neighbor; } message Graph { repeated string names; repeated Node nodes; } And use the name (or some other unique identifier) to figure

Re: [protobuf] post-processing compiled artefacts in plugins

2013-07-08 Thread Feng Xiao
On Wed, Jul 3, 2013 at 6:59 PM, Motiejus Jakštys desired@gmail.comwrote: Hi all, I am writing Python protoc plugin which wants to add some Python to resulting artifacts. However, there is an issue. For it to work I must do some acrobatics to get the file name in the plugin. The name of

Re: [protobuf] Casting of pb.h into regular header files and vice versa

2013-07-08 Thread Feng Xiao
On Sun, Jul 7, 2013 at 4:15 PM, zedan...@gmail.com wrote: I currently have multiple classes in my project some of these classes use boost serialization and these classes are used at various places in the project. I now need to serialize some of these classes and send them across the network

Re: [protobuf] Partial Decoding of message

2013-07-08 Thread Kevin Regan
This is how I handle the same issue. This would be similar to most multi-threaded daemons taking client input. The manager reads the message type and passes the socket/stream to a handling thread. On Monday, July 8, 2013 10:59:12 AM UTC-7, Ilia Mirkin wrote: Unfortunately it's not