Zserio C++17 runtime library  0.5.0
Built for Zserio 2.17.0
zserio::IBasicIntrospectableView< ALLOC > Class Template Referenceabstract

#include <IIntrospectableView.h>

Inheritance diagram for zserio::IBasicIntrospectableView< ALLOC >:
Collaboration diagram for zserio::IBasicIntrospectableView< ALLOC >:

Public Types

using ConstPtr = typename IIntrospectableData< IBasicIntrospectableView< ALLOC >, ALLOC >::ConstPtr
 
- Public Types inherited from zserio::IIntrospectableData< IBasicIntrospectableView< std::allocator< uint8_t > >, std::allocator< uint8_t > >
using ConstPtr = std::shared_ptr< const IBasicIntrospectableView< std::allocator< uint8_t > > >
 

Public Member Functions

 ~IBasicIntrospectableView () override=default
 
virtual ConstPtr getParameter (std::string_view name) const =0
 
virtual ConstPtr callFunction (std::string_view name) const =0
 
virtual BasicBitBuffer< ALLOC > serialize (const ALLOC &allocator) const =0
 
virtual BasicBitBuffer< ALLOC > serialize () const =0
 
- Public Member Functions inherited from zserio::IIntrospectableData< IBasicIntrospectableView< std::allocator< uint8_t > >, std::allocator< uint8_t > >
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
 

Detailed Description

template<typename ALLOC = std::allocator<uint8_t>>
class zserio::IBasicIntrospectableView< ALLOC >

Interface to introspect View abstraction of the Zserio objects.

This is read-only interface which offers all information available from the View abstraction of the Zserio objects including parameters, functions and serialization feature.

Definition at line 21 of file IIntrospectableView.h.

Member Typedef Documentation

◆ ConstPtr

template<typename ALLOC = std::allocator<uint8_t>>
using zserio::IBasicIntrospectableView< ALLOC >::ConstPtr = typename IIntrospectableData<IBasicIntrospectableView<ALLOC>, ALLOC>::ConstPtr

Shared pointer to the constant introspectable interface.

Definition at line 25 of file IIntrospectableView.h.

Constructor & Destructor Documentation

◆ ~IBasicIntrospectableView()

template<typename ALLOC = std::allocator<uint8_t>>
zserio::IBasicIntrospectableView< ALLOC >::~IBasicIntrospectableView ( )
overridedefault

Destructor.

Member Function Documentation

◆ callFunction()

template<typename ALLOC = std::allocator<uint8_t>>
virtual ConstPtr zserio::IBasicIntrospectableView< ALLOC >::callFunction ( std::string_view  name) const
pure virtual

Calls function on the introspectable zserio object and gets introspectable view to its result.

Note
Can be called only when the introspectable object is a zserio compound type.
Parameters
nameFunction schema name.
Returns
Reflectable view to the value returns from the called function.
Exceptions
CppRuntimeExceptionWhen the introspectable object is not a compound type or when the function with the given name doesn't exist or the the function call itself throws.

◆ getParameter()

template<typename ALLOC = std::allocator<uint8_t>>
virtual ConstPtr zserio::IBasicIntrospectableView< ALLOC >::getParameter ( std::string_view  name) const
pure virtual

Gets introspectable to the parameter (i.e. member) with the given schema name.

Note
Can be called only when the introspectable object is a zserio compound type.
Parameters
nameParameter schema name.
Returns
Reflectable to the requested parameter.
Exceptions
CppRuntimeExceptionWhen the introspectable object is not a compound type or when the parameter with the given name doesn't exist or when the parameter getter itself throws.

◆ serialize() [1/2]

template<typename ALLOC = std::allocator<uint8_t>>
virtual BasicBitBuffer<ALLOC> zserio::IBasicIntrospectableView< ALLOC >::serialize ( ) const
pure virtual

Serializes the introspectable compound object.

Parameters
allocatorAllocator to use for the value allocation.
Exceptions
CppRuntimeExceptionWhen the introspectable object is not a compound.
Returns
Allocated bit buffer containing the serialized compound object.

◆ serialize() [2/2]

template<typename ALLOC = std::allocator<uint8_t>>
virtual BasicBitBuffer<ALLOC> zserio::IBasicIntrospectableView< ALLOC >::serialize ( const ALLOC &  allocator) const
pure virtual

Serializes the introspectable compound object.

Parameters
allocatorAllocator to use for the value allocation.
Exceptions
CppRuntimeExceptionWhen the introspectable object is not a compound.
Returns
Allocated bit buffer containing the serialized compound object.

The documentation for this class was generated from the following file: