I am new to protobuf and here is my question: Can protocol buffer support 
partial update?

For example, I have such messages:

package model.test;

message Person{
    required int32 id = 1;
    required string name = 2;
    repeated PhoneNumber phone = 3;}
enum PhoneType{
    MOBILE = 0;
    HOME = 1;
    WORK = 2;}

message PhoneNumber{
    required string number = 1;
    optional PhoneType type = 2 [default = HOME];} 

Now the data I have like that:

model::test::Person person;
person.set_id(1);
person.set_name("Jack");

model::test::PhoneNumber* _phone3 = person.add_phone();
_phone3->set_number("123567");
_phone3->set_type(model::test::MOBILE);

model::test::PhoneNumber* _phone4 = person.add_phone();
_phone4->set_number("347890");
_phone4->set_type(model::test::WORK);

The case is that when only work phone number is changed, I have to update 
the whole person object with the following codes.

fstream out("User.txt", ios::out | ios::binary | ios::trunc);
person.SerializePartialToOstream(&out);

But it is not efficient to do that. I want to only update the PhoneNumber, 
Is there any partial update in protolbuf or something like that?

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to