RTI Connext Modern C++ API  Version 6.0.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::flat::MutableSequenceBuilder< ElementBuilder > Class Template Reference

Builds a sequence member of variable-size elements. More...

#include <SequenceBuilders.hpp>

Inheritance diagram for rti::flat::MutableSequenceBuilder< ElementBuilder >:
rti::flat::AbstractSequenceBuilder rti::flat::AbstractListBuilder rti::flat::AbstractBuilder

Public Types

typedef SequenceOffset
< typename
ElementBuilder::Offset > 
Offset
 The related Offset type.
 

Public Member Functions

ElementBuilder build_next ()
 Begins building the next element.
 
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.
 

Detailed Description

template<typename ElementBuilder>
class rti::flat::MutableSequenceBuilder< ElementBuilder >

Builds a sequence member of variable-size elements.

Template Parameters
ElementBuilderThe Builder type for the elements of the sequence

To build the elements use the ElementBuilder returned by build_next(). An empty sequence can be built by calling finish() without any call to build_next().

This class doesn't enforce the sequence bound set in IDL.

The following example uses a MutableSequenceBuilder to initialize a sequence member of MyFlatMutableBuilder with two elements:

auto seq_builder = builder.build_my_mutable_seq();
auto element_builder = seq_builder.build_next();
// ... build the first element
element_builder.finish();
element_builder = seq_builder.build_next();
// ... build the second element
element_builder.finish();
seq_builder.finish();

Member Typedef Documentation

template<typename ElementBuilder >
typedef SequenceOffset<typename ElementBuilder::Offset> rti::flat::MutableSequenceBuilder< ElementBuilder >::Offset

The related Offset type.

Member Function Documentation

template<typename ElementBuilder >
ElementBuilder rti::flat::MutableSequenceBuilder< ElementBuilder >::build_next ( )
inline

Begins building the next element.

Before calling build_next() to create a new element, the application must have called finish() on the previous element Builder.

template<typename ElementBuilder >
Offset rti::flat::MutableSequenceBuilder< ElementBuilder >::finish ( )
inline

Finishes building the sequence.

Returns
An Offset to the member that has been built.
See Also
discard()

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