We discussed that inheritance is not a good choice here, so perhaps we should use composition. After some consideration I realized that the current arrangement will require much manual tinkering in the presentation layer and above.
struct TransferMetadata final
{
TransferId transfer_id{};
TimePoint timestamp;
Priority priority{};
};
struct MessageTransferMetadata final
{
TransferMetadata base;
cetl::optional<NodeId> publisher_node_id;
};
struct ServiceTransferMetadata final
{
TransferMetadata base;
NodeId remote_node_id{};
};
Here:
https://github.com/OpenCyphal-Garage/libcyphal/blob/5e652de5cb6c9172b833fb8426ba619ce99c4963/include/libcyphal/transport/types.hpp#L58-L79
We discussed that inheritance is not a good choice here, so perhaps we should use composition. After some consideration I realized that the current arrangement will require much manual tinkering in the presentation layer and above.