RTI Connext Traditional C++ API
Version 6.0.0
|
Base class of all Builders. More...
#include <Builder.hpp>
Public Member Functions | |
void | discard () |
Discards a member in process of being built. | |
bool | is_nested () const |
Returns whether this is a member Builder. | |
bool | is_valid () const |
Whether this Builder is valid. | |
rti::xcdr::length_t | capacity () const |
Returns the total capacity in bytes. | |
bool | check_failure () |
Checks if the previous operation failed and resets the failure flag. | |
Protected Member Functions | |
virtual | ~AbstractBuilder () |
If this is a member Builder, it calls finish(). | |
Base class of all Builders.
|
inlineprotectedvirtual |
If this is a member Builder, it calls finish().
If this Builder is building a member (that is, is_nested() is true), and the object goes out of scope before finish() has been called, its destructor calls finish(). Note, however, that it won't report any error.
If this Builder is building a sample (!is_nested()), its destructor doesn't do anything.
|
inline |
Discards a member in process of being built.
This function ends the creation of a member, returning the Builder of the type that contains the member to its previous state, as if this member had never been built.
This method is useful when during the building of a member an error occurs and the application wants to roll back, instead of finishing an incomplete member.
|
inline |
Returns whether this is a member Builder.
A member Builder is a Builder that has been created by calling a "build_<member>"
function on another Builder (for example, MyFlatMutableBuilder::build_my_mutable()).
|
inline |
Whether this Builder is valid.
A Builder is not valid when it is default-constructed, or after any of these functions is called: finish(), finish_sample(), discard().
Since the Traditional C++ API doesn't use exceptions, certain function failures due to the Builder running out resources are also reported by invalidating the Builder.
|
inline |
Returns the total capacity in bytes.
The capacity is the total number of bytes this Builder can contain. For a sample Builder (that is, one such that is_nested() returns false), rti::flat::build_data reserves enough bytes to accommodate any sample of a given type.
|
inline |
Checks if the previous operation failed and resets the failure flag.
This function must be called after each Builder operation to check if it succeeded. Note that after calling check_failure() the error flag is reset, so a subsequent call will always return false.