C++ Actor Framework  0.18
Public Types | Public Member Functions | List of all members
caf::config_value_reader Class Referencefinal

Extracts objects from a config_value. More...

#include <config_value_reader.hpp>

Inheritance diagram for caf::config_value_reader:
Inheritance graph
Collaboration diagram for caf::config_value_reader:
Collaboration graph

Public Types

using super = deserializer
 
using key_ptr = const std::string *
 
using value_type = variant< const settings *, const config_value *, key_ptr, absent_field, sequence, associative_array >
 
using stack_type = std::stack< value_type, std::vector< value_type > >
 
- Public Types inherited from caf::deserializer
using super = load_inspector_base< deserializer >
 

Public Member Functions

 config_value_reader (const config_value *input, actor_system &sys)
 
 config_value_reader (const config_value *input, execution_unit *ctx)
 
 config_value_reader (const config_value *input)
 
 config_value_reader (const config_value_reader &)=delete
 
config_value_readeroperator= (const config_value_reader &)=delete
 
value_typetop ()
 
void pop ()
 
bool fetch_next_object_type (type_id_t &type) override
 Reads run-time-type information for the next object if available.
 
bool begin_object (type_id_t type, string_view name) override
 Begins processing of an object, may perform a type check depending on the data format. More...
 
bool end_object () override
 Ends processing of an object.
 
bool begin_field (string_view) override
 
bool begin_field (string_view name, bool &is_present) override
 
bool begin_field (string_view name, span< const type_id_t > types, size_t &index) override
 
bool begin_field (string_view name, bool &is_present, span< const type_id_t > types, size_t &index) override
 
bool end_field () override
 
bool begin_tuple (size_t size) override
 Begins processing of a fixed-size sequence.
 
bool end_tuple () override
 Ends processing of a sequence.
 
bool begin_key_value_pair () override
 Begins processing of a tuple with two elements, whereas the first element represents the key in an associative array. More...
 
bool end_key_value_pair () override
 Ends processing of a key-value pair after both values were written. More...
 
bool begin_sequence (size_t &size) override
 Begins processing of a sequence.
 
bool end_sequence () override
 Ends processing of a sequence.
 
bool begin_associative_array (size_t &size) override
 Begins processing of an associative array (map). More...
 
bool end_associative_array () override
 Ends processing of an associative array (map). More...
 
bool value (byte &x) override
 Reads x from the input. More...
 
bool value (bool &x) override
 Reads x from the input. More...
 
bool value (int8_t &x) override
 Reads x from the input. More...
 
bool value (uint8_t &x) override
 Reads x from the input. More...
 
bool value (int16_t &x) override
 Reads x from the input. More...
 
bool value (uint16_t &x) override
 Reads x from the input. More...
 
bool value (int32_t &x) override
 Reads x from the input. More...
 
bool value (uint32_t &x) override
 Reads x from the input. More...
 
bool value (int64_t &x) override
 Reads x from the input. More...
 
bool value (uint64_t &x) override
 Reads x from the input. More...
 
bool value (float &x) override
 Reads x from the input. More...
 
bool value (double &x) override
 Reads x from the input. More...
 
bool value (long double &x) override
 Reads x from the input. More...
 
bool value (std::string &x) override
 Reads x from the input. More...
 
bool value (std::u16string &x) override
 Reads x from the input. More...
 
bool value (std::u32string &x) override
 Reads x from the input. More...
 
bool value (span< byte > x) override
 Reads a byte sequence from the input. More...
 
- Public Member Functions inherited from caf::deserializer
 deserializer (actor_system &sys) noexcept
 
 deserializer (execution_unit *ctx=nullptr) noexcept
 
auto context () const noexcept
 
bool has_human_readable_format () const noexcept
 
template<class T >
std::enable_if_t< std::is_integral< T >::value, bool > value (T &x) noexcept
 Reads x from the input. More...
 
virtual bool list (std::vector< bool > &xs)
 Adds each boolean in xs to the output. More...
 

Additional Inherited Members

- Protected Attributes inherited from caf::deserializer
execution_unitcontext_
 Provides access to the ::proxy_registry and to the ::actor_system.
 
bool has_human_readable_format_ = false
 Configures whether client code should assume human-readable output.
 

Detailed Description

Extracts objects from a config_value.

Member Function Documentation

◆ begin_associative_array()

bool caf::config_value_reader::begin_associative_array ( size_t &  size)
overridevirtual

Begins processing of an associative array (map).

Note
the default implementation calls begin_sequence(size).

Reimplemented from caf::deserializer.

◆ begin_key_value_pair()

bool caf::config_value_reader::begin_key_value_pair ( )
overridevirtual

Begins processing of a tuple with two elements, whereas the first element represents the key in an associative array.

Note
the default implementation calls begin_tuple(2).

Reimplemented from caf::deserializer.

◆ begin_object()

bool caf::config_value_reader::begin_object ( type_id_t  type,
string_view  pretty_class_name 
)
overridevirtual

Begins processing of an object, may perform a type check depending on the data format.

Parameters
type16-bit ID for known types, invalid_type_id otherwise.
pretty_class_nameEither the output of type_name_or_anonymous or the optionally defined pretty name.

Implements caf::deserializer.

◆ end_associative_array()

bool caf::config_value_reader::end_associative_array ( )
overridevirtual

Ends processing of an associative array (map).

Note
the default implementation calls end_sequence().

Reimplemented from caf::deserializer.

◆ end_key_value_pair()

bool caf::config_value_reader::end_key_value_pair ( )
overridevirtual

Ends processing of a key-value pair after both values were written.

Note
the default implementation calls end_tuple().

Reimplemented from caf::deserializer.

◆ value() [1/17]

bool caf::config_value_reader::value ( byte x)
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [2/17]

bool caf::config_value_reader::value ( bool &  x)
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [3/17]

bool caf::config_value_reader::value ( int8_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [4/17]

bool caf::config_value_reader::value ( uint8_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [5/17]

bool caf::config_value_reader::value ( int16_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [6/17]

bool caf::config_value_reader::value ( uint16_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [7/17]

bool caf::config_value_reader::value ( int32_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [8/17]

bool caf::config_value_reader::value ( uint32_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [9/17]

bool caf::config_value_reader::value ( int64_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [10/17]

bool caf::config_value_reader::value ( uint64_t &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [11/17]

bool caf::config_value_reader::value ( float &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [12/17]

bool caf::config_value_reader::value ( double &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [13/17]

bool caf::config_value_reader::value ( long double &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [14/17]

bool caf::config_value_reader::value ( std::string &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [15/17]

bool caf::config_value_reader::value ( std::u16string &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [16/17]

bool caf::config_value_reader::value ( std::u32string &  )
overridevirtual

Reads x from the input.

Parameters
xA reference to a builtin type.
Returns
true on success, false otherwise.

Implements caf::deserializer.

◆ value() [17/17]

bool caf::config_value_reader::value ( span< byte x)
overridevirtual

Reads a byte sequence from the input.

Parameters
xThe byte sequence.
Returns
A non-zero error code on failure, sec::success otherwise.

Implements caf::deserializer.


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