I have protobuf:
message Msg
{
oneof type {
Msg1 msg1 = 1;
Msg2 msg2 = 2;
Msg3 msg3 = 3;
....
}
};
Is it possible to fill Msg with protobuf::Message from one of msgs?
Like:
msg1 m1;
//fill m1;
f(&m1);
msg2 m2;
//fill m2;
f(&m2);
...
void f(google::protobuf::Message *m)
{
Msg mainMessage;
// fill mainMessage with data from m correctly? <---
}
I tried CopyFrom but it doesn't work in this case.
Thank you.