Re: Joining multiple protocol buffer packages into a single C++ namespace?

56 views
Skip to first unread message

Carl

unread,
Sep 2, 2012, 8:24:09 PM9/2/12
to prot...@googlegroups.com
Found the answer: 

Package MathPB; 

becomes

Package WrapperPackage.MathPB;

puts it all in a c++ namespace  WrapperPackage 

Regards
Carl


On Monday, August 27, 2012 10:39:41 AM UTC-4, Carl wrote:

Greetings:

                I know that using a line like this:

Package MathPB;

In a .proto file yields a C++ namespace of MathPB.

But assuming I have multiple proto files such as math.proto, material.proto, and mechanical.proto, each one in their own “PB package”, now I want to wrap these into one larger package called EngineeringPB.
I  guessed a number of possible ways this might be done  in the proto file, but no love.

So in C++ speak addressing one would look like:

                EngineeringPB::MechanicalPB::gearPB()      <- to get to a gear objects message.

I sure hope I missed something in the doc, because the script the refactor the output of N number of packages gets real ugly.

Regards

Carl

Reply all
Reply to author
Forward
0 new messages