RTI Connext Traditional C++ API Version 7.5.0
|
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. More... | |
Public Member Functions | |
ElementBuilder | build_next () |
Begins building the next element. More... | |
Offset | finish () |
Finishes building the array. More... | |
![]() | |
void | discard () |
Discards a member in process of being built. More... | |
bool | is_nested () const |
Returns whether this is a member Builder. More... | |
bool | is_valid () const |
Whether this Builder is valid. More... | |
rti::xcdr::length_t | capacity () const |
Returns the total capacity in bytes. More... | |
bool | check_failure () |
Checks if the previous operation failed and resets the failure flag. More... | |
Additional Inherited Members | |
![]() | |
unsigned int | element_count () const |
Returns the current number of elements that have been added. More... | |
![]() | |
virtual | ~AbstractBuilder () |
If this is a member Builder, it calls finish(). More... | |
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< detail::DHeaderGenerator >::element_count().
|
inline |
Finishes building the array.
N
times exactly. References rti::flat::AbstractListBuilder< detail::DHeaderGenerator >::element_count().