Zserio C++ runtime library
1.1.0
Built for Zserio 2.15.0
|
#include <ZserioTreeCreator.h>
Public Member Functions | |
BasicZserioTreeCreator (const IBasicTypeInfo< ALLOC > &typeInfo, const ALLOC &allocator=ALLOC()) | |
void | beginRoot () |
IBasicReflectablePtr< ALLOC > | endRoot () |
void | beginArray (const string< ALLOC > &name) |
void | endArray () |
void | beginCompound (const string< ALLOC > &name) |
void | endCompound () |
template<typename T > | |
void | setValue (const string< ALLOC > &name, T &&value) |
void | setValue (const string< ALLOC > &name, std::nullptr_t nullValue) |
const IBasicTypeInfo< ALLOC > & | getFieldType (const string< ALLOC > &name) const |
void | beginCompoundElement () |
void | endCompoundElement () |
template<typename T > | |
void | addValueElement (T &&value) |
const IBasicTypeInfo< ALLOC > & | getElementType () const |
Allows to build zserio object tree defined by the given type info.
Definition at line 422 of file ZserioTreeCreator.h.
|
explicit |
Constructor.
typeInfo | Type info defining the tree. |
Definition at line 564 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::addValueElement | ( | T && | value | ) |
Adds the value to the array.
value | Value to add. |
CppRuntimeException | When the creator is not in an array of simple values. |
Definition at line 790 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::beginArray | ( | const string< ALLOC > & | name | ) |
Creates an array field within the current compound.
name | Name of the array field. |
CppRuntimeException | When the field doesn't exist or when the creator is not in a compound. |
Definition at line 599 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::beginCompound | ( | const string< ALLOC > & | name | ) |
Creates a compound field within the current compound.
name | Name of the compound field. |
CppRuntimeException | When the field doesn't exist or when the creator is not in a compound. |
Definition at line 641 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::beginCompoundElement |
Creates compound array element within the current array.
CppRuntimeException | When the creator is not in an array of compounds. |
Definition at line 748 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::beginRoot |
Creates the top level compound element and move to state of building its children.
Definition at line 573 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::endArray |
Finishes the array field.
CppRuntimeException | When the creator is not in an array field. |
Definition at line 628 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::endCompound |
Finishes the compound.
CppRuntimeException | When the creator is not in a compound. |
Definition at line 676 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::endCompoundElement |
Finishes the compound element.
CppRuntimeException | When the creator is not in a compound element. |
Definition at line 770 of file ZserioTreeCreator.h.
IBasicReflectablePtr< ALLOC > zserio::BasicZserioTreeCreator< ALLOC >::endRoot |
Finishes building and returns the created tree.
CppRuntimeException | When the creator is not in state of building the root object. |
Definition at line 585 of file ZserioTreeCreator.h.
const IBasicTypeInfo< ALLOC > & zserio::BasicZserioTreeCreator< ALLOC >::getElementType |
Gets type info of the expected array element.
CppRuntimeException | When the creator is not in an array. |
Definition at line 802 of file ZserioTreeCreator.h.
const IBasicTypeInfo< ALLOC > & zserio::BasicZserioTreeCreator< ALLOC >::getFieldType | ( | const string< ALLOC > & | name | ) | const |
Gets type info of the expected field.
name | Field name. |
CppRuntimeException | When the creator is not in a compound. |
Definition at line 737 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::setValue | ( | const string< ALLOC > & | name, |
std::nullptr_t | nullValue | ||
) |
Overload for setting of a null value.
Note that this does nothing in C++ since non-optional fields are always present (default initialized).
name | Name of the field. |
nullValue | Null value. |
CppRuntimeException | When the field doesn't exist or when the creator is not in a compound. |
Definition at line 715 of file ZserioTreeCreator.h.
void zserio::BasicZserioTreeCreator< ALLOC >::setValue | ( | const string< ALLOC > & | name, |
T && | value | ||
) |
Sets field value within the current compound.
name | Name of the field. |
value | Value to set. |
CppRuntimeException | When the field doesn't exist or when the creator is not in a compound. |
Definition at line 696 of file ZserioTreeCreator.h.