Class to store a number of fields of heterogeneous types, in a way that provides ABI compatibility.
This provides ABI compatibility in two ways:
- Packets can be passed as function parameters in calls between two shared objects that are linked dynamically, even if compiled with different options/compilers. This is works because the class satisfies std::is_standard_layout, which enforces a defined order of struct members. This holds only if memory alignment is the same, which is not guaranteed by the C++ standard, but typicall is the same across compilers on the same system. If stricter guarantees on memory alignment is ever needed, this needs to be replaced by something else.
- Packet definitions can evolve over time, by adding new type codes and abandoning (but not removing) old ones, and then packets can be shared between shared objects that expect different packet definitions.
- Template Parameters
-
Type_enum_t | Enumeration type to use for the type code in the Field objects. |