RTI Connext Traditional C++ API  Version 6.0.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::flat::PrimitiveOffset< T > Struct Template Reference

An Offset to an optional primitive member. More...

#include <Offset.hpp>

Inheritance diagram for rti::flat::PrimitiveOffset< T >:
rti::flat::PrimitiveConstOffset< T > rti::flat::OffsetBase

Public Member Functions

bool set (T value)
 Sets a value for this primitive member.
 
- Public Member Functions inherited from rti::flat::PrimitiveConstOffset< T >
get () const
 Gets the value of this primitive member.
 
- Public Member Functions inherited from rti::flat::OffsetBase
bool is_null () const
 Indicates whether this Offset doesn't point to a valid element.
 
bool is_cpp_compatible () const
 Indicates whether rti::flat::plain_cast() is possible.
 
const unsigned char * get_buffer () const
 Gets this member's position in the buffer.
 
offset_t get_buffer_size () const
 Gets the size, in bytes, of this member in the buffer.
 

Detailed Description

template<typename T>
struct rti::flat::PrimitiveOffset< T >

An Offset to an optional primitive member.

Template Parameters
TThe primitive type

Non-optional primitive members are accessed directly using its container type's methods; however, since an optional member may not exist, this Offset is returned instead. The only purpose of the type PrimitiveOffset is to provide a way to check for the member's existence.

If !is_null(), the value can be retrieved with get() or set with set().

See Also
MyFlatMutableOffset::my_optional_primitive vs. MyFlatMutableOffset::my_primitive

Member Function Documentation

template<typename T>
bool rti::flat::PrimitiveOffset< T >::set ( value)
inline

Sets a value for this primitive member.

Precondition
!is_null()

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