RTI Connext Modern C++ API
Version 6.1.1
|
Represents the Offset to an arbitrary user-defined FlatData mutable IDL union. More...
#include <Offset.hpp>
Public Types | |
typedef MyFlatUnionConstOffset | ConstOffset |
The equivalent read-only Offset type. More... | |
Public Member Functions | |
MyFlatUnionOffset () | |
Creates a null Offset. More... | |
int32_t | _d () const |
Retrieves the union discriminator. More... | |
int32_t | my_primitive () const |
Retrieves the value for a primitive member. More... | |
MyFlatMutable::ConstOffset | my_mutable () const |
Retrieves a const Offset to a complex member. More... | |
MyFlatFinal::ConstOffset | my_final () const |
Retrieves a const Offset to a complex member. More... | |
bool | my_primitive (int32_t value) |
Sets the value for a primitive member. More... | |
MyFlatMutable::Offset | my_mutable () |
Retrieves a non-const Offset to a complex member. More... | |
MyFlatFinal::Offset | my_final () |
Retrieves a non-const Offset to a complex member. More... | |
![]() | |
bool | is_null () const |
Indicates whether this Offset doesn't point to a valid element. More... | |
bool | is_cpp_compatible () const |
Indicates whether rti::flat::plain_cast() is possible. More... | |
const unsigned char * | get_buffer () const |
Gets this member's position in the buffer. More... | |
offset_t | get_buffer_size () const |
Gets the size, in bytes, of this member in the buffer. More... | |
Represents the Offset to an arbitrary user-defined FlatData mutable IDL union.
This example type represents the Offset type that rtiddsgen would generate for MyFlatUnion.
It provides accessors for each of its members, plus the discriminator _d(). Accessors can return other Offsets or primitive values.
Given a union, only one member, the one identified by _d(), can exist at a time. The discriminator cannot be modified.
typedef MyFlatUnionConstOffset MyFlatUnionOffset::ConstOffset |
The equivalent read-only Offset type.
|
inline |
int32_t MyFlatUnionOffset::_d | ( | ) | const |
Retrieves the union discriminator.
In this example:
Any other discriminator value indicates that no member or an unknown member follows.
Note that the discriminator cannot be modified, since that would potentially change the size of this Sample by selecting a different member. The discriminator is selected during the building of a Sample (see MyUnionBuilder).
int32_t MyFlatUnionOffset::my_primitive | ( | ) | const |
Retrieves the value for a primitive member.
MyFlatMutable::ConstOffset MyFlatUnionOffset::my_mutable | ( | ) | const |
Retrieves a const Offset to a complex member.
MyFlatFinal::ConstOffset MyFlatUnionOffset::my_final | ( | ) | const |
Retrieves a const Offset to a complex member.
bool MyFlatUnionOffset::my_primitive | ( | int32_t | value | ) |
Sets the value for a primitive member.
MyFlatMutable::Offset MyFlatUnionOffset::my_mutable | ( | ) |
Retrieves a non-const Offset to a complex member.
MyFlatFinal::Offset MyFlatUnionOffset::my_final | ( | ) |
Retrieves a non-const Offset to a complex member.