My .proto file looks like
message Cmd
{
int code = 1;
}
message CmdOne
{
required Cmd cmd = 1;
required int data = 2;
}
message CmdTwo
{
required Cmd cmd = 1;
required string data = 2;
}
In my cpp file, I want to declare objects of CmdOne and CmdTwo and set both cmd and data members. But the generated pb.h file does not have a set method for the cmd member of CmdOne and CmdTwo objects, but has a set method for the data member. How do I set the value of cmd for each object?
I don't want to define message Cmd inside CmdOne and CmdTwo messages. I want to reuse the Cmd message as I have 10 messages CmdOne to CmdTen.