Zserio C++17 runtime library
0.5.0
Built for Zserio 2.17.0
|
#include <IIntrospectableData.h>
Public Types | |
using | ConstPtr = std::shared_ptr< const I > |
Public Member Functions | |
virtual | ~IIntrospectableData ()=default |
virtual const IBasicTypeInfo< ALLOC > & | getTypeInfo () const =0 |
virtual bool | isArray () const =0 |
virtual ConstPtr | getField (std::string_view name) const =0 |
virtual std::string_view | getChoice () const =0 |
virtual size_t | size () const =0 |
virtual ConstPtr | at (size_t index) const =0 |
virtual ConstPtr | operator[] (size_t index) const =0 |
virtual bool | getBool () const =0 |
virtual int8_t | getInt8 () const =0 |
virtual int16_t | getInt16 () const =0 |
virtual int32_t | getInt32 () const =0 |
virtual int64_t | getInt64 () const =0 |
virtual uint8_t | getUInt8 () const =0 |
virtual uint16_t | getUInt16 () const =0 |
virtual uint32_t | getUInt32 () const =0 |
virtual uint64_t | getUInt64 () const =0 |
virtual float | getFloat () const =0 |
virtual double | getDouble () const =0 |
virtual BytesView | getBytes () const =0 |
virtual std::string_view | getStringView () const =0 |
virtual const BasicBitBuffer< ALLOC > & | getBitBuffer () const =0 |
virtual int64_t | toInt () const =0 |
virtual uint64_t | toUInt () const =0 |
virtual double | toDouble () const =0 |
virtual ConstPtr | find (std::string_view path) const =0 |
virtual ConstPtr | operator[] (std::string_view path) const =0 |
virtual BasicAny< ALLOC > | getAnyValue (const ALLOC &allocator) const =0 |
virtual BasicAny< ALLOC > | getAnyValue () const =0 |
virtual BasicString< RebindAlloc< ALLOC, char > > | toString (const ALLOC &allocator) const =0 |
virtual BasicString< RebindAlloc< ALLOC, char > > | toString () const =0 |
Interface to introspect Data abstraction of the Zserio objects.
This is read-only interface which offers all information available from the Data abstraction of the Zserio objects.
Definition at line 27 of file IIntrospectableData.h.
using zserio::IIntrospectableData< I, ALLOC >::ConstPtr = std::shared_ptr<const I> |
Shared pointer to the constant introspectable interface.
Definition at line 31 of file IIntrospectableData.h.
|
virtualdefault |
Destructor.
|
pure virtual |
Gets the introspectable to an array element.
CppRuntimeException | When the introspective object is not an array or when the given index is out of bounds of the underlying array. |
|
pure virtual |
Universal accessor to zserio entities within the zserio sub-tree represented by the introspectable 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. |
|
pure virtual |
Gets any value within the introspective 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 string_view 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. |
|
pure virtual |
Gets any value within the introspective 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 string_view 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. |
|
pure virtual |
Gets reference to the introspective bit buffer.
CppRuntimeException | When the introspective object is not a bit buffer (i.e. extern type). |
|
pure virtual |
Gets bool value of the bool introspectable.
CppRuntimeException | When the introspective object is not a bool type. |
|
pure virtual |
Gets byte value of the bytes introspectable.
CppRuntimeException | When the introspective object is not a bytes type. |
|
pure virtual |
Gets name of the field which is active in the introspectable choice type.
CppRuntimeException | When the introspectable object is not a choice type (or union). |
|
pure virtual |
Gets double value of the double introspectable.
CppRuntimeException | When the introspective object is not a double type. |
|
pure virtual |
Gets the introspectable to the field (i.e. member) with the given schema name.
name | Field schema name. |
CppRuntimeException | When the object is not a compound type or when the field with the given name doesn't exist or when the field getter itself throws. |
|
pure virtual |
Gets float value of the float introspectable.
CppRuntimeException | When the introspective object is not a float type. |
|
pure virtual |
Gets 16-bit signed integral value of the int16_t introspectable.
CppRuntimeException | When the introspective object is not a int16_t type. |
|
pure virtual |
Gets 32-bit signed integral value of the int32_t introspectable.
CppRuntimeException | When the introspective object is not a int32_t type. |
|
pure virtual |
Gets 64-bit signed integral value of the int64_t introspectable.
CppRuntimeException | When the introspective object is not a int64_t type. |
|
pure virtual |
Gets 8-bit signed integral value of the int8_t introspectable.
CppRuntimeException | When the introspective object is not a int8_t type. |
|
pure virtual |
Gets reference to the string value of the string introspectable.
CppRuntimeException | When the introspective object is not a string type. |
|
pure virtual |
Gets type info for the current zserio object.
|
pure virtual |
Gets 16-bit unsigned integral value of the uint16_t introspectable.
CppRuntimeException | When the introspective object is not a uint16_t type. |
|
pure virtual |
Gets 32-bit unsigned integral value of the uint32_t introspectable.
CppRuntimeException | When the introspective object is not a uint32_t type. |
|
pure virtual |
Gets 64-bit unsigned integral value of the uint64_t introspectable.
CppRuntimeException | When the introspective object is not a uint64_t type. |
|
pure virtual |
Gets 8-bit unsigned integral value of the uint8_t introspectable.
CppRuntimeException | When the introspective object is not a uint8_t type. |
|
pure virtual |
Gets whether the introspective object is an array.
|
pure virtual |
Gets the introspectable to an array element.
CppRuntimeException | When the introspective object is not an array or when the given index is out of bounds of the underlying array. |
Overloaded method provided for convenience.
|
pure virtual |
Universal accessor to zserio entities within the zserio sub-tree represented by the introspectable 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.
|
pure virtual |
Gets size of the introspective array.
CppRuntimeException | When the introspective object is not an array. |
|
pure virtual |
Converts any numeric value to double.
Works also for bitmask and enum types.
CppRuntimeException | When the introspective object cannot be converted to double. |
|
pure virtual |
Converts any signed integral value to 64-bit signed integer.
Works also for enum types defined with signed underlying type.
CppRuntimeException | When the introspective object cannot be converted to a signed integral value. |
|
pure virtual |
Converts an introspective 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. |
|
pure virtual |
Converts an introspective 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. |
|
pure virtual |
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 introspective object cannot be converted to an unsigned integral value. |