I want to introduce a different method of deserialization and serialization when generating to protobuf files.
In essence, after running protoc -I=/home/ubuntu/protobuf-3.21.6/src -I=./ --cpp_out=./ addressbook.proto
from the examples I would want to generate custom uint8_t* Person_PhoneNumber::_InternalSerialize
functions.
Those functions should change the serialization method on a condition like the size of the message itself.
Ideally I would want to keep the function signatures same and use something like protobuf plugins to achieve this. The key is for the additional functionality to be be included without changing the API.
What is the best way to extend the protobuf compiler without changing the source code?