RTI Connext Traditional C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MyFlatUnionOffset Class Reference

Represents the Offset to an arbitrary user-defined FlatData mutable IDL union. More...

#include <Offset.hpp>

Inheritance diagram for MyFlatUnionOffset:
rti::flat::MutableOffset rti::flat::OffsetBase

Public Types

typedef MyFlatUnionConstOffset ConstOffset
 The equivalent read-only Offset type.
 

Public Member Functions

 MyFlatUnionOffset ()
 Creates a null Offset.
 
int32_t _d () const
 Retrieves the union discriminator.
 
int32_t my_primitive () const
 Retrieves the value for a primitive member.
 
MyFlatMutable::ConstOffset my_mutable () const
 Retrieves a const Offset to a complex member.
 
MyFlatFinal::ConstOffset my_final () const
 Retrieves a const Offset to a complex member.
 
bool my_primitive (int32_t value)
 Sets the value for a primitive member.
 
MyFlatMutable::Offset my_mutable ()
 Retrieves a non-const Offset to a complex member.
 
MyFlatFinal::Offset my_final ()
 Retrieves a non-const Offset to a complex member.
 

Detailed Description

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.

Member Typedef Documentation

typedef MyFlatUnionConstOffset MyFlatUnionOffset::ConstOffset

The equivalent read-only Offset type.

Constructor & Destructor Documentation

MyFlatUnionOffset::MyFlatUnionOffset ( )
inline

Creates a null Offset.

Postcondition
is_null()

Member Function Documentation

int32_t MyFlatUnionOffset::_d ( ) const

Retrieves the union discriminator.

Returns
The union discriminator, which identifies which field this union contains.

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.

Returns
The value of my_primitive if this member is selected by _d() or its default value otherwise.
MyFlatMutable::ConstOffset MyFlatUnionOffset::my_mutable ( ) const

Retrieves a const Offset to a complex member.

Returns
The Offset to the 'my_mutable' member if selected by _d(), or a null Offset otherwise
MyFlatFinal::ConstOffset MyFlatUnionOffset::my_final ( ) const

Retrieves a const Offset to a complex member.

Returns
The Offset to the 'my_final' member if selected by _d(), or a null Offset otherwise
bool MyFlatUnionOffset::my_primitive ( int32_t  value)

Sets the value for a primitive member.

Precondition
_d() must select 'my_primitive', otherwise this function returns false.
Returns
true if my_primitive was set or false if the operation failed.
MyFlatMutable::Offset MyFlatUnionOffset::my_mutable ( )

Retrieves a non-const Offset to a complex member.

Returns
The Offset to the 'my_mutable' member if selected by _d(), or a null Offset otherwise
MyFlatFinal::Offset MyFlatUnionOffset::my_final ( )

Retrieves a non-const Offset to a complex member.

Returns
The Offset to the 'my_final' member if selected by _d(), or a null Offset otherwise

RTI Connext Traditional C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc