RTI Connext Modern C++ API
Version 6.1.2
|
Represents the Builder for an arbitrary user-defined mutable IDL union. More...
#include <Builder.hpp>
Public Types | |
typedef MyFlatUnionOffset | Offset |
The related offset type. More... | |
Public Member Functions | |
MyFlatUnionBuilder () | |
Creates an invalid Builder. More... | |
Offset | finish () |
Finishes building a member. More... | |
MyFlatUnion * | finish_sample () |
Finishes building a sample. More... | |
bool | add_my_primitive (int32_t value) |
Adds a primitive member. More... | |
MyFlatMutableBuilder | build_my_mutable (int32_t discriminator=1) |
Builds a mutable-struct member. More... | |
MyFlatFinal::Offset | add_my_final () |
Adds a final-struct member. More... | |
Public Member Functions inherited from rti::flat::AbstractBuilder | |
void | discard () |
Discards a member in process of being built. More... | |
bool | is_nested () const |
Returns whether this is a member Builder. More... | |
bool | is_valid () const |
Whether this Builder is valid. More... | |
rti::xcdr::length_t | capacity () const |
Returns the total capacity in bytes. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from rti::flat::AbstractBuilder | |
virtual | ~AbstractBuilder () |
If this is a member Builder, it calls finish(). More... | |
Represents the Builder for an arbitrary user-defined mutable IDL union.
This example type represents the Builder type that rtiddsgen would generate for MyFlatUnion and allows creating a sample or a member of that type.
Union builders are similar to struct builders (see MyFlatMutableBuilder), except that they only allow adding/building one member.
"Add" and "build" functions automatically set the discriminator value that in the IDL definition selects that member. If more than one discriminator value selects a member, the add/build function allows picking one.
The related offset type.
|
inline |
Creates an invalid Builder.
build_<member>
function. Offset MyFlatUnionBuilder::finish | ( | ) |
Finishes building a member.
MyFlatUnion* MyFlatUnionBuilder::finish_sample | ( | ) |
Finishes building a sample.
bool MyFlatUnionBuilder::add_my_primitive | ( | int32_t | value | ) |
Adds a primitive member.
This function automatically selects the discriminator 0, which corresponds to the member 'my_primitive' (see MyFlatUnion)
MyFlatMutableBuilder MyFlatUnionBuilder::build_my_mutable | ( | int32_t | discriminator = 1 | ) |
Builds a mutable-struct member.
discriminator | Allows selecting one of the possible discriminator values for this member: 1 or 2. This argument is optional: if not specified it selects the first 'case' label in the IDL definition (1). |
MyFlatFinal::Offset MyFlatUnionBuilder::add_my_final | ( | ) |
Adds a final-struct member.
This function automatically selects the discriminator value 3, which corresponds to the member 'my_final' (see MyFlatUnion).