RTI Connext Modern C++ API
Version 6.1.1
|
A Sample represents an instance of the IDL topic-type and contains the data in serialized format. More...
Classes | |
class | rti::flat::Sample< OffsetType > |
The generic definition of FlatData topic-types. More... | |
struct | rti::flat::flat_type_traits< T > |
Given a Sample, an Offset or a Builder, it allows obtaining the other types. More... | |
Typedefs | |
typedef rti::flat::Sample< MyFlatFinalOffset > | MyFlatFinal |
Represents an arbitrary user-defined FlatData final IDL struct. More... | |
typedef rti::flat::Sample< MyFlatMutableOffset > | MyFlatMutable |
Represents an arbitrary user-defined flat mutable IDL struct. More... | |
typedef rti::flat::Sample< MyFlatUnionOffset > | MyFlatUnion |
Represents an arbitrary user-defined flat mutable IDL union. More... | |
A Sample represents an instance of the IDL topic-type and contains the data in serialized format.
All FlatData topic-types are instantiations of rti::flat::Sample. This documentation uses the following three example types to illustrate the different ways FlatData IDL types map to C++:
Represents an arbitrary user-defined FlatData final IDL struct.
This documentation uses the following example IDL definition of MyFlatFinal:
For this type, rtiddsgen generates:
Note that, as a final FlatData type, MyFlatFinal can only contain fixed-size types, such as primitives, other final FlatData structs, and arrays of fixed-size types.
Samples of MyFlatFinal are created with dds::pub::DataWriter::get_loan. After creating a final Sample, modify its values using the MyFlatFinalOffset returned by root().
Represents an arbitrary user-defined flat mutable IDL struct.
This documentation uses the following example IDL definition of MyFlatMutable:
For this type, rtiddsgen generates:
As a mutable FlatData type, MyFlatMutable is not restricted to fixed-size members. Samples of MyFlatMutable are created with rti::flat::build_data(), which returns a MyFlatMutableBuilder. Once built, a mutable Sample can't change in size, but the value of members that already exist can be changed using the MyFlatMutableOffset returned by root().
Represents an arbitrary user-defined flat mutable IDL union.
This documentation uses the following example IDL definition of MyFlatUnion:
For this type, rtiddsgen generates: