Open osrf-migration opened 7 years ago
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Related to #17, #18, and #19: I looked at seeing if c++ code generated by protobuf would maintian ABI compatibility if fields are added, they're not. Fields are added to the classes as private member variables, so adding one will change the size of the class. This rules out using a generated protobuf class as the API used by systems for reading/writing components.
If the data was serialized and then passed to the systems adding fields is ABI compatible. Systems would have their own compiled version of the generated protobuf class which has support for forwards/backwards compatibility within some limits. A downside is it adds the overhead of serializing/deserializing instead of just reading from the component.
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Will be solved once pull request #37 and pull request #36 are merged.
Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Currently components are structs/unions that expose their member variables directly. This is great for speed of reading/writing from them, but means any changes to a component will break ABI. Components should use the PIMPL pattern or something similar so that maintenance isn't a difficult issue in the future.