Zserio C++ runtime library
1.0.2
Built for Zserio 2.14.1
|
#include <Reflectable.h>
Public Member Functions | |
ReflectableOwner () | |
ReflectableOwner (const ALLOC &allocator) | |
const IBasicTypeInfo< ALLOC > & | getTypeInfo () const override |
bool | isArray () const override |
void | initializeChildren () override |
void | initialize (const vector< AnyHolder< ALLOC >, ALLOC > &typeArguments) override |
size_t | initializeOffsets (size_t bitPosition) override |
size_t | initializeOffsets () override |
size_t | bitSizeOf (size_t bitPosition) const override |
size_t | bitSizeOf () const override |
void | write (BitStreamWriter &writer) const override |
IBasicReflectableConstPtr< ALLOC > | getField (StringView name) const override |
IBasicReflectablePtr< ALLOC > | getField (StringView name) override |
IBasicReflectablePtr< ALLOC > | createField (StringView name) override |
void | setField (StringView name, const AnyHolder< ALLOC > &value) override |
IBasicReflectableConstPtr< ALLOC > | getParameter (StringView name) const override |
IBasicReflectablePtr< ALLOC > | getParameter (StringView name) override |
IBasicReflectableConstPtr< ALLOC > | callFunction (StringView name) const override |
IBasicReflectablePtr< ALLOC > | callFunction (StringView name) override |
StringView | getChoice () const override |
IBasicReflectableConstPtr< ALLOC > | find (StringView path) const override |
IBasicReflectablePtr< ALLOC > | find (StringView path) override |
IBasicReflectableConstPtr< ALLOC > | operator[] (StringView path) const override |
IBasicReflectablePtr< ALLOC > | operator[] (StringView path) override |
size_t | size () const override |
void | resize (size_t size) override |
IBasicReflectableConstPtr< ALLOC > | at (size_t index) const override |
IBasicReflectablePtr< ALLOC > | at (size_t index) override |
IBasicReflectableConstPtr< ALLOC > | operator[] (size_t index) const override |
IBasicReflectablePtr< ALLOC > | operator[] (size_t index) override |
void | setAt (const AnyHolder< ALLOC > &value, size_t index) override |
void | append (const AnyHolder< ALLOC > &value) override |
AnyHolder< ALLOC > | getAnyValue (const ALLOC &allocator) const override |
AnyHolder< ALLOC > | getAnyValue (const ALLOC &allocator) override |
AnyHolder< ALLOC > | getAnyValue () const override |
AnyHolder< ALLOC > | getAnyValue () override |
bool | getBool () const override |
int8_t | getInt8 () const override |
int16_t | getInt16 () const override |
int32_t | getInt32 () const override |
int64_t | getInt64 () const override |
uint8_t | getUInt8 () const override |
uint16_t | getUInt16 () const override |
uint32_t | getUInt32 () const override |
uint64_t | getUInt64 () const override |
float | getFloat () const override |
double | getDouble () const override |
Span< const uint8_t > | getBytes () const override |
StringView | getStringView () const override |
const BasicBitBuffer< ALLOC > & | getBitBuffer () const override |
int64_t | toInt () const override |
uint64_t | toUInt () const override |
double | toDouble () const override |
string< RebindAlloc< ALLOC, char > > | toString (const ALLOC &allocator) const override |
string< RebindAlloc< ALLOC, char > > | toString () const override |
Public Member Functions inherited from zserio::IBasicReflectable< typename T::allocator_type > | |
virtual | ~IBasicReflectable ()=default |
virtual void | initialize (const vector< AnyHolder< typename T::allocator_type >, typename T::allocator_type > &typeArguments)=0 |
virtual void | setField (StringView name, const AnyHolder< typename T::allocator_type > &value)=0 |
virtual void | setAt (const AnyHolder< typename T::allocator_type > &value, size_t index)=0 |
virtual void | append (const AnyHolder< typename T::allocator_type > &value)=0 |
virtual AnyHolder< typename T::allocator_type > | getAnyValue (const typename T::allocator_type &allocator) const=0 |
virtual AnyHolder< typename T::allocator_type > | getAnyValue (const typename T::allocator_type &allocator)=0 |
virtual string< typename T::allocator_type > | toString (const typename T::allocator_type &allocator) const=0 |
Additional Inherited Members | |
Public Types inherited from zserio::IBasicReflectable< typename T::allocator_type > | |
using | Ptr = std::shared_ptr< IBasicReflectable > |
using | ConstPtr = std::shared_ptr< const IBasicReflectable > |
Wrapper around reflectable which actually owns the reflected object.
This is needed in ZserioTreeCreator to be able to generically create the new instance of a zserio object.
Definition at line 3138 of file Reflectable.h.
|
inline |
Definition at line 3141 of file Reflectable.h.
|
inlineexplicit |
Definition at line 3145 of file Reflectable.h.
|
inlineoverride |
Definition at line 3295 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to an array element.
CppRuntimeException | When the reflected object is not an array or when the given index is out of bounds of the underlying array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3270 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to an array element.
CppRuntimeException | When the reflected object is not an array or when the given index is out of bounds of the underlying array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3275 of file Reflectable.h.
|
inlineoverridevirtual |
Gets the number of bits needed for serialization of the reflected object.
The bit stream position to be used for calculation is defaulted to zero.
CppRuntimeException | When the reflected object is an array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3185 of file Reflectable.h.
|
inlineoverridevirtual |
Gets the number of bits needed for serialization of the reflected object.
bitPosition | The bit stream position to be used for calculation. |
CppRuntimeException | When the reflected object is an array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3180 of file Reflectable.h.
|
inlineoverridevirtual |
Calls function with the given name on the reflected zserio object and gets reflectable view to its result.
name | Function schema name. |
CppRuntimeException | When the reflected object is not a compound type or when the function with the given name doesn't exist or the the function call itself throws. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3225 of file Reflectable.h.
|
inlineoverridevirtual |
Calls function with the given name on the reflected zserio object and gets reflectable view to its result.
name | Function schema name. |
CppRuntimeException | When the reflected object is not a compound type or when the function with the given name doesn't exist or the the function call itself throws. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3230 of file Reflectable.h.
|
inlineoverridevirtual |
Creates a default constructed field within current object and returns reflectable pointer to it.
name | Name of the optional field to create. |
CppRuntimeException | When the reflected object is not a compound type or when the field with the given name doesn't exists. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3205 of file Reflectable.h.
|
inlineoverridevirtual |
Universal accessor to zserio entities within the zserio sub-tree represented by the reflected object.
Supports dot notation corresponding to the tree defined in zserio language. Can access fields or parameters or call functions within the zserio sub-tree.
Examples:
path | Dot notation corresponding to the zserio tree. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3240 of file Reflectable.h.
|
inlineoverridevirtual |
Universal accessor to zserio entities within the zserio sub-tree represented by the reflected object.
Supports dot notation corresponding to the tree defined in zserio language. Can access fields or parameters or call functions within the zserio sub-tree.
Examples:
path | Dot notation corresponding to the zserio tree. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3245 of file Reflectable.h.
|
inlineoverridevirtual |
Gets any value within the reflected object.
For builtin types, enums and bitmasks the value is "returned by value" - i.e. it's copied into the any holder, but note that for bytes the any holder contains Span, for string the any holder contains an appropriate StringView and for compounds, bit buffers and arrays the value is "returned by reference" - i.e. the any holder contains std::reference_wrapper<T> with the reference to the compound type or the raw array type.
allocator | Allocator to use for the value allocation. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3310 of file Reflectable.h.
|
inlineoverridevirtual |
Gets any value within the reflected object.
For builtin types, enums and bitmasks the value is "returned by value" - i.e. it's copied into the any holder, but note that for bytes the any holder contains Span, for string the any holder contains an appropriate StringView and for compounds, bit buffers and arrays the value is "returned by reference" - i.e. the any holder contains std::reference_wrapper<T> with the reference to the compound type or the raw array type.
allocator | Allocator to use for the value allocation. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3315 of file Reflectable.h.
|
inlineoverride |
Definition at line 3300 of file Reflectable.h.
|
inlineoverride |
Definition at line 3305 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reference to the reflected bit buffer.
CppRuntimeException | When the reflected object is not a bit buffer (i.e. extern type). |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3373 of file Reflectable.h.
|
inlineoverridevirtual |
Gets bool value of the bool reflectable.
CppRuntimeException | When the reflected object is not a bool type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3321 of file Reflectable.h.
|
inlineoverridevirtual |
Gets byte value of the bytes reflectable.
CppRuntimeException | When the reflected object is not a bytes type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3365 of file Reflectable.h.
|
inlineoverridevirtual |
Gets name of the field which is active in the reflected choice type.
CppRuntimeException | When the reflected object is not a choice type (or union). |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3235 of file Reflectable.h.
|
inlineoverridevirtual |
Gets double value of the double reflectable.
CppRuntimeException | When the reflected object is not a double type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3361 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to the field (i.e. member) with the given schema name.
name | Field schema name. |
CppRuntimeException | When the reflected object is not a compound type or when the field with the given name doesn't exist or when the field getter itself throws. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3195 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to the field (i.e. member) with the given schema name.
name | Field schema name. |
CppRuntimeException | When the reflected object is not a compound type or when the field with the given name doesn't exist or when the field getter itself throws. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3200 of file Reflectable.h.
|
inlineoverridevirtual |
Gets float value of the float reflectable.
CppRuntimeException | When the reflected object is not a float type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3357 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 16-bit signed integral value of the int16_t reflectable.
CppRuntimeException | When the reflected object is not a int16_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3329 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 32-bit signed integral value of the int32_t reflectable.
CppRuntimeException | When the reflected object is not a int32_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3333 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 64-bit signed integral value of the int64_t reflectable.
CppRuntimeException | When the reflected object is not a int64_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3337 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 8-bit signed integral value of the int8_t reflectable.
CppRuntimeException | When the reflected object is not a int8_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3325 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to the parameter (i.e. member) with the given schema name.
name | Parameter schema name. |
CppRuntimeException | When the reflected object is not a compound type or when the parameter with the given name doesn't exist or when the parameter getter itself throws. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3215 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to the parameter (i.e. member) with the given schema name.
name | Parameter schema name. |
CppRuntimeException | When the reflected object is not a compound type or when the parameter with the given name doesn't exist or when the parameter getter itself throws. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3220 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reference to the string value of the string reflectable.
CppRuntimeException | When the reflected object is not a string type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3369 of file Reflectable.h.
|
inlineoverridevirtual |
Gets type info for the current zserio object.
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3150 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 16-bit unsigned integral value of the uint16_t reflectable.
CppRuntimeException | When the reflected object is not a uint16_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3345 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 32-bit unsigned integral value of the uint32_t reflectable.
CppRuntimeException | When the reflected object is not a uint32_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3349 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 64-bit unsigned integral value of the uint64_t reflectable.
CppRuntimeException | When the reflected object is not a uint64_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3353 of file Reflectable.h.
|
inlineoverridevirtual |
Gets 8-bit unsigned integral value of the uint8_t reflectable.
CppRuntimeException | When the reflected object is not a uint8_t type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3341 of file Reflectable.h.
|
inlineoverride |
Definition at line 3165 of file Reflectable.h.
|
inlineoverridevirtual |
Initializes children of the reflected compound. Calls initializeChildren method on the generated C++ object, which recursively initializes the whole object tree. When nothing within the object tree is parameterized, does nothing.
CppRuntimeException | When the reflected object is not a compound type. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3160 of file Reflectable.h.
|
inlineoverridevirtual |
Initializes indexed offsets of the reflected compound object.
The bit stream position to be used for calculation is defaulted to zero.
CppRuntimeException | When the reflected object is not a compound. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3175 of file Reflectable.h.
|
inlineoverridevirtual |
Initializes indexed offsets of the reflected compound object.
bitPosition | The bit stream position to be used for calculation. |
CppRuntimeException | When the reflected object is not a compound. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3170 of file Reflectable.h.
|
inlineoverridevirtual |
Gets whether the reflected object is an array.
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3155 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to an array element.
CppRuntimeException | When the reflected object is not an array or when the given index is out of bounds of the underlying array. |
Overloaded method provided for convenience.
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3280 of file Reflectable.h.
|
inlineoverridevirtual |
Gets reflectable view to an array element.
CppRuntimeException | When the reflected object is not an array or when the given index is out of bounds of the underlying array. |
Overloaded method provided for convenience.
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3285 of file Reflectable.h.
|
inlineoverridevirtual |
Universal accessor to zserio entities within the zserio sub-tree represented by the reflected object.
Supports dot notation corresponding to the tree defined in zserio language. Can access fields or parameters or call functions within the zserio sub-tree.
Examples:
path | Dot notation corresponding to the zserio tree. |
Overloaded method provided for convenience.
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3250 of file Reflectable.h.
|
inlineoverridevirtual |
Universal accessor to zserio entities within the zserio sub-tree represented by the reflected object.
Supports dot notation corresponding to the tree defined in zserio language. Can access fields or parameters or call functions within the zserio sub-tree.
Examples:
path | Dot notation corresponding to the zserio tree. |
Overloaded method provided for convenience.
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3255 of file Reflectable.h.
|
inlineoverridevirtual |
Resizes the reflected array.
size | New array size. |
CppRuntimeException | When the reflected object is not an array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3265 of file Reflectable.h.
|
inlineoverride |
Definition at line 3290 of file Reflectable.h.
|
inlineoverride |
Definition at line 3210 of file Reflectable.h.
|
inlineoverridevirtual |
Gets size of the reflected array.
CppRuntimeException | When the reflected object is not an array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3260 of file Reflectable.h.
|
inlineoverridevirtual |
Converts any numeric value to double.
Works also for bitmask and enum types.
CppRuntimeException | When the reflected object cannot be converted to double. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3387 of file Reflectable.h.
|
inlineoverridevirtual |
Converts any signed integral value to 64-bit signed integer.
Works also for enum types defined with signed underlying type.
CppRuntimeException | When the reflected object cannot be converted to a signed integral value. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3379 of file Reflectable.h.
|
inlineoverridevirtual |
Converts an reflected object to string.
Works for all integral types including bool, bitmask and enum types and for string types.
allocator | Allocator to use for the string allocation. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3395 of file Reflectable.h.
|
inlineoverride |
Definition at line 3391 of file Reflectable.h.
|
inlineoverridevirtual |
Converts any unsigned integral value to 64-bit unsigned integer.
Works also for bitmask and enum typed defined with unsigned underlying type.
CppRuntimeException | When the reflected object cannot be converted to an unsigned integral value. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3383 of file Reflectable.h.
|
inlineoverridevirtual |
Writes the reflected object to a bit stream using the given bit stream writer.
writer | Bit stream writer to use. |
CppRuntimeException | When the reflected object is an array. |
Implements zserio::IBasicReflectable< typename T::allocator_type >.
Definition at line 3190 of file Reflectable.h.