I want to add an array of double to protobuf message object. I already
have an array of doubles allocated in my program, and I want to
serialize this information. Currently, I am doing this by adding
individual elements as follows:

        for(unsigned i=0; i <size; i++) {
                // double_pb is Protobuf Message object defined
in .proto file
                double_pb->add_data(doubleArray[i]); \

Is there a function that I can use to add double arrays
(RepeatedField<double>) by passing a pointer to the array and the size
of the array?

The .proto file:
message DoubleData {
    repeated double data = 1 [packed=true];

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to