RTI Connext Modern C++ API Version 7.3.0
rti::flat::AbstractPrimitiveList< T > Class Template Reference

Base class for Offsets to sequences and arrays of primitive types. More...

#include <SequenceOffsets.hpp>

Inheritance diagram for rti::flat::AbstractPrimitiveList< T >:
rti::flat::OffsetBase rti::flat::PrimitiveArrayOffset< T, N > rti::flat::PrimitiveSequenceOffset< T >

Public Member Functions

get_element (unsigned int i) const
 Returns an element by index. More...
 
bool set_element (unsigned int i, T value)
 Sets an element by index. More...
 
- Public Member Functions inherited from rti::flat::OffsetBase
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...
 

Detailed Description

template<typename T>
class rti::flat::AbstractPrimitiveList< T >

Base class for Offsets to sequences and arrays of primitive types.

Template Parameters
TThe primitive type

Member Function Documentation

◆ get_element()

template<typename T >
T rti::flat::AbstractPrimitiveList< T >::get_element ( unsigned int  i) const
inline

Returns an element by index.

Parameters
iThe zero-based index of the element
See also
rti::flat::plain_cast() for a method to access all the elements at once

◆ set_element()

template<typename T >
bool rti::flat::AbstractPrimitiveList< T >::set_element ( unsigned int  i,
value 
)
inline

Sets an element by index.

Parameters
iThe zero-based index of the element to set
valueThe value to set
Returns
true if it was possible to set the element, or false if this collection has less than i - 1 elements.
See also
rti::flat::plain_cast() for a method to access all the elements at once