jeudi 13 avril 2017

Find and set data to a sub message by message path in protocol buffer

I'm newbie of Google buffer protocol, and now I have an issue as below: I have a path string and value like that:

path_string = "classA.classB.classC.foo_variable ";
set_value = 1000;

a common set function:

void set(path_string, set_value);

and some messages:

message classA {
...
classB = 1;
}
message classB {
...
classC =1;
}
message classC {
...
int foo_variable = 10;
}

Now with the path_string I need to find out the foo_variable and set its value to 1000. How can I do it with google buffer protocol?





Aucun commentaire:

Enregistrer un commentaire