CAF  0.17.3
Public Types | Public Member Functions | Protected Attributes | List of all members
caf::deserializer Class Referenceabstract

#include <deserializer.hpp>

Inheritance diagram for caf::deserializer:
caf::write_inspector< deserializer >

Public Types

using result_type = error
 

Public Member Functions

 deserializer (actor_system &sys) noexcept
 
 deserializer (execution_unit *ctx=nullptr) noexcept
 
auto context () const noexcept
 
virtual result_type begin_object (uint16_t &typenr, std::string &type_name)=0
 Begins processing of an object.
 
virtual result_type end_object ()=0
 Ends processing of an object.
 
virtual result_type begin_sequence (size_t &size)=0
 Begins processing of a sequence.
 
virtual result_type end_sequence ()=0
 Ends processing of a sequence.
 
virtual result_type apply (bool &x)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (int8_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (uint8_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (int16_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (uint16_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (int32_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (uint32_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (int64_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (uint64_t &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (float &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (double &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (long double &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (std::string &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (std::u16string &)=0
 Reads primitive value from the input. More...
 
virtual result_type apply (std::u32string &)=0
 Reads primitive value from the input. More...
 
template<class Enum , class = std::enable_if_t<std::is_enum<Enum>::value>>
auto apply (Enum &x)
 Reads primitive value from the input. More...
 
virtual result_type apply (span< byte > x)=0
 Reads a byte sequence from the input. More...
 
virtual result_type apply (std::vector< bool > &xs) noexcept
 Adds each boolean in xs to the output. More...
 
- Public Member Functions inherited from caf::write_inspector< deserializer >
auto operator() (Ts &&... xs)
 

Protected Attributes

execution_unitcontext_
 Provides access to the ::proxy_registry and to the ::actor_system.
 

Additional Inherited Members

- Static Public Attributes inherited from caf::write_inspector< deserializer >
static constexpr bool reads_state
 
static constexpr bool writes_state
 

Detailed Description

Technology-independent deserialization interface.

Member Function Documentation

◆ apply() [1/18]

virtual result_type caf::deserializer::apply ( bool &  x)
pure virtual

Reads primitive value from the input.

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

◆ apply() [2/18]

virtual result_type caf::deserializer::apply ( double &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [3/18]

template<class Enum , class = std::enable_if_t<std::is_enum<Enum>::value>>
auto caf::deserializer::apply ( Enum &  x)

Reads primitive value from the input.

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

◆ apply() [4/18]

virtual result_type caf::deserializer::apply ( float &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [5/18]

virtual result_type caf::deserializer::apply ( int16_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [6/18]

virtual result_type caf::deserializer::apply ( int32_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [7/18]

virtual result_type caf::deserializer::apply ( int64_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [8/18]

virtual result_type caf::deserializer::apply ( int8_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [9/18]

virtual result_type caf::deserializer::apply ( long double &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [10/18]

virtual result_type caf::deserializer::apply ( span< byte x)
pure virtual

Reads a byte sequence from the input.

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

◆ apply() [11/18]

virtual result_type caf::deserializer::apply ( std::string &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [12/18]

virtual result_type caf::deserializer::apply ( std::u16string &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [13/18]

virtual result_type caf::deserializer::apply ( std::u32string &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [14/18]

virtual result_type caf::deserializer::apply ( std::vector< bool > &  xs)
virtualnoexcept

Adds each boolean in xs to the output.

Derived classes can override this member function to pack the booleans, for example to avoid using one byte for each value in a binary output format.

◆ apply() [15/18]

virtual result_type caf::deserializer::apply ( uint16_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [16/18]

virtual result_type caf::deserializer::apply ( uint32_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [17/18]

virtual result_type caf::deserializer::apply ( uint64_t &  )
pure virtual

Reads primitive value from the input.

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

◆ apply() [18/18]

virtual result_type caf::deserializer::apply ( uint8_t &  )
pure virtual

Reads primitive value from the input.

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

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