RTI Connext Traditional C++ API
Version 6.0.1
|
Builds an array member of variable-size elements. More...
#include <SequenceBuilders.hpp>
Public Types | |
typedef MutableArrayOffset < typename ElementBuilder::Offset, N > | Offset |
The related Offset type. | |
Public Member Functions | |
ElementBuilder | build_next () |
Begins building the next element. | |
Offset | finish () |
Finishes building the array. | |
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 an array member of variable-size elements.
ElementBuilder | The Builder type for the elements of the array |
N | The array bound; the exact number of elements this array builder must build. For multidimensional arrays, N is the product of each dimension bound. |
Each element of this array needs to be built using the ElementBuilder returned by build_next(). N elements exactly must be built. Unlike a sequence Builder, it is not possible to finish an array with less than N elements.
This example shows how to use a MutableArrayBuilder to build an array member of MyFlatMutableBuilder:
Note that Builder types are not necessary for arrays of fixed-size elements, since they are added at once (see MyFlatMutableBuilder::add_my_final_array()).
typedef MutableArrayOffset<typename ElementBuilder::Offset, N> rti::flat::MutableArrayBuilder< ElementBuilder, N >::Offset |
The related Offset type.
|
inline |
Begins building the next element.
Before calling build_next() to create a new element, the element Builder returned by a previous call to build_next must have been finished.
References rti::flat::AbstractListBuilder::element_count().
|
inline |
Finishes building the array.
N
times exactly. References rti::flat::AbstractListBuilder::element_count().