Zserio C++17 runtime library
0.5.0
Built for Zserio 2.17.0
|
#include <IReflectableData.h>
Public Types | |
using | Ptr = std::shared_ptr< IBasicReflectableData > |
using | ConstPtr = typename IIntrospectableData< IBasicReflectableData< ALLOC >, ALLOC >::ConstPtr |
![]() | |
using | ConstPtr = std::shared_ptr< const IBasicReflectableData< std::allocator< uint8_t > > > |
Public Member Functions | |
~IBasicReflectableData () override=default | |
virtual Ptr | getField (std::string_view name)=0 |
virtual void | setField (std::string_view name, const BasicAny< ALLOC > &value)=0 |
virtual Ptr | createField (std::string_view name)=0 |
virtual void | resize (size_t size)=0 |
virtual Ptr | at (size_t index)=0 |
virtual Ptr | operator[] (size_t index)=0 |
virtual void | setAt (const BasicAny< ALLOC > &value, size_t index)=0 |
virtual void | append (const BasicAny< ALLOC > &value)=0 |
virtual Ptr | find (std::string_view path)=0 |
virtual Ptr | operator[] (std::string_view path)=0 |
virtual BasicAny< ALLOC > | getAnyValue (const ALLOC &allocator)=0 |
virtual BasicAny< ALLOC > | getAnyValue ()=0 |
![]() | |
virtual | ~IIntrospectableData ()=default |
virtual const IBasicTypeInfo< std::allocator< uint8_t > > & | 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 ConstPtr | operator[] (std::string_view path) 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< std::allocator< uint8_t > > & | 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 BasicAny< std::allocator< uint8_t > > | getAnyValue (const std::allocator< uint8_t > &allocator) const=0 |
virtual BasicAny< std::allocator< uint8_t > > | getAnyValue () const=0 |
virtual BasicString< RebindAlloc< std::allocator< uint8_t >, char > > | toString (const std::allocator< uint8_t > &allocator) const=0 |
virtual BasicString< RebindAlloc< std::allocator< uint8_t >, char > > | toString () const=0 |
Interface for reflection of the Zserio objects using Data abstraction.
This interface allows modification of all information available in the Data abstraction of the Zserio objects.
Definition at line 19 of file IReflectableData.h.
using zserio::IBasicReflectableData< ALLOC >::ConstPtr = typename IIntrospectableData<IBasicReflectableData<ALLOC>, ALLOC>::ConstPtr |
Shared pointer to the constant reflectable interface.
Definition at line 26 of file IReflectableData.h.
using zserio::IBasicReflectableData< ALLOC >::Ptr = std::shared_ptr<IBasicReflectableData> |
Shared pointer to the reflectable interface.
Definition at line 23 of file IReflectableData.h.
|
overridedefault |
Destructor.
|
pure virtual |
Appends an element at the given index within the reflected array.
value | Value to append. |
CppRuntimeException | When the reflected object is not an array. |
|
pure virtual |
Gets reflectable 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. |
|
pure virtual |
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. |
|
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 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 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 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 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 reflectable 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. |
|
pure virtual |
Gets reflectable 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.
|
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 |
Resizes the reflected array.
size | New array size. |
CppRuntimeException | When the reflected object is not an array. |
|
pure virtual |
Sets an element value at the given index within the reflected array.
value | Value to set. |
index | Index of the element to set. |
CppRuntimeException | When the reflected object is not an array. |
|
pure virtual |
Sets the field (i.e. member) with the given schema name.
name | Field schema name. |
value | Value to set. The type must exactly match the type of the zserio field mapped to C++! |
CppRuntimeException | When the reflected object is not a compound type or when the field with the given name doesn't exist or when the provided value is of a wrong type or when the field setter itself throws. |