RTI Connext Modern C++ API
Version 6.0.1
|
Builds a sequence member of fixed-size elements. More...
#include <SequenceBuilders.hpp>
Public Member Functions | |
ElementOffset | add_next () |
Adds the next element. | |
FinalSequenceBuilder & | add_n (unsigned int count) |
Adds a number of elements at once. | |
Offset | finish () |
Finishes building the sequence. | |
Additional Inherited Members | |
Protected Member Functions inherited from rti::flat::AbstractListBuilder | |
unsigned int | element_count () const |
Returns the current number of elements that have been added. | |
Builds a sequence member of fixed-size elements.
ElementOffset | The Offset type for the elements of the sequence |
To add an element, call add_next() and use the ElementOffset it returns to initialize the element's values. An empty sequence can be built by calling finish() without any call to add_next().
This class doesn't enforce the sequence bound set in IDL.
The following example uses a FinalSequenceBuilder to initialize a sequence member of MyFlatMutableBuilder with two elements:
If the element type meets certain requirements, rti::flat::plain_cast() provides a more efficient way to initialize a sequence of final elements.
|
inline |
Adds the next element.
|
inline |
Adds a number of elements at once.
This is an alternative to add_next().
To initialize the elements, call finish() and use the Offset it returns to access the elements.
|
inline |
Finishes building the sequence.