c++ - Extending protocol buffers -


is there way add functionality class methods, generated protocol buffers? goal able add message .proto file, , automatically generate class sent on network on each data change (e.g. network exchange can managed custom class written in advance same peer on end). achieve need @ least generate custom code in set_ methods calls predefined callback notify buffer changed.

no, isn't supported. accessors inline methods, not virtual, can't override them.

you consider writing custom code generator generates wrappers around each type additional setter logic. write code generator plugin if trying support new language, you'd output c++ code #includes regular c++ output , defines wrapper types. see:

https://developers.google.com/protocol-buffers/docs/reference/other


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -