RTI Connext Traditional C++ API  Version 6.0.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MyFlatUnionBuilder Class Reference

Represents the Builder for an arbitrary user-defined mutable IDL union. More...

#include <Builder.hpp>

Inheritance diagram for MyFlatUnionBuilder:
rti::flat::UnionBuilder< int32_t > rti::flat::AggregationBuilder rti::flat::AbstractBuilder

Public Types

typedef MyFlatUnionOffset Offset
 The related offset type.
 

Public Member Functions

 MyFlatUnionBuilder ()
 Creates an invalid Builder.
 
Offset finish ()
 Finishes building a member.
 
MyFlatUnionfinish_sample ()
 Finishes building a sample.
 
bool add_my_primitive (int32_t value)
 Adds a primitive member.
 
MyFlatMutableBuilder build_my_mutable (int32_t discriminator=1)
 Builds a mutable-struct member.
 
MyFlatFinal::Offset add_my_final ()
 Adds a final-struct member.
 

Additional Inherited Members

- Protected Member Functions inherited from rti::flat::AbstractBuilder
virtual ~AbstractBuilder ()
 If this is a member Builder, it calls finish().
 

Detailed Description

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.

Member Typedef Documentation

The related offset type.

Constructor & Destructor Documentation

MyFlatUnionBuilder::MyFlatUnionBuilder ( )
inline

Creates an invalid Builder.

Postcondition
!is_valid()
Note
Top-level builders are created with rti::flat::build_data(), and member builders are created with the corresponding build_<member> function.

Member Function Documentation

Offset MyFlatUnionBuilder::finish ( )

Finishes building a member.

See Also
MyMutableBuilder::finish()
MyFlatUnion* MyFlatUnionBuilder::finish_sample ( )

Finishes building a sample.

See Also
MyMutableBuilder::finish_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.

Parameters
discriminatorAllows 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).
Returns
The Builder to build this member
MyFlatFinal::Offset MyFlatUnionBuilder::add_my_final ( )

Adds a final-struct member.

Returns
The Offset to the member, which can be used to set its values.

This function automatically selects the discriminator value 3, which corresponds to the member 'my_final' (see MyFlatUnion).


RTI Connext Traditional C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc