How do I add Protobuf message methods?
Suppose I have a .proto file:
package proto; message Person { required string name = 1; required int32 id = 2; optional string email = 3; }
and I want to add in the message, for example, the string concatenateNameEmail() .
Now I am creating my own C ++ class:
class Person : public proto::Person { public: Person( proto::Person const & person_ ) : proto::Person(person_) {} string concateNateNameEmail() { ... } };
So, the disadvantage is that I need to call proto :: Person copy constructor. Is there a more elegant solution than this?
c ++ protocol-buffers
sivabudh
source share