Loading...
Searching...
No Matches
caf::stream_serializer< Streambuf > Class Template Reference

Implements the serializer interface with a binary serialization protocol. More...

`#include <stream_serializer.hpp>`

Inheritance diagram for caf::stream_serializer< Streambuf >:

## Public Member Functions

template<class... Ts>
| stream_serializer (actor_system &sys, Ts &&... xs)
template<class... Ts>
| stream_serializer (execution_unit *ctx, Ts &&... xs)
template<class S, class = typename std::enable_if< std::is_same< typename std::remove_reference<S>::type, typename std::remove_reference<Streambuf>::type >::value >::type>
| stream_serializer (S &&sb)
error | begin_object (uint16_t &typenr, std::string &name) override
| Begins processing of an object.
error | end_object () override
| Ends processing of an object.
error | begin_sequence (size_t &list_size) override
| Begins processing of a sequence.
error | end_sequence () override
| Ends processing of a sequence.
error | apply_raw (size_t num_bytes, void *data) override
| Applies this processor to a raw block of data of size num_bytes.
Public Member Functions inherited from caf::serializer
| serializer (actor_system &sys)
| serializer (execution_unit *ctx=nullptr)
Public Member Functions inherited from caf::data_processor< serializer >
| data_processor (const data_processor &)=delete
data_processor & | operator= (const data_processor &)=delete
| data_processor (execution_unit *ctx=nullptr)
execution_unit * | context ()
| Returns the actor system associated to this data processor.
std::enable_if< std::is_floating_point< T >::value, error >::type | apply (T &x)
| Applies this processor to an arithmetic type.
std::enable_if< std::is_integral< T >::value &&!std::is_same< bool, T >::value, error >::type | apply (T &x)
error | apply (std::string &x)
error | apply (std::u16string &x)
error | apply (std::u32string &x)
error | apply (atom_constant< V > &x)
std::enable_if< std::is_enum< T >::value &&!detail::has_serialize< T >::value, error >::type | apply (T &x)
| Serializes enums using the underlying type if no user-defined serialization is defined.
std::enable_if< std::is_empty< T >::value &&!detail::is_inspectable< serializer, T >::value, error >::type | apply (T &)
| Applies this processor to an empty type.
error | apply (bool &x)
error | apply (std::vector< bool > &x)
error | consume_range (T &xs)
error | consume_range_c (T &xs)
| Converts each element in xs to U before calling apply.
error | fill_range (T &xs, size_t num_elements)
error | fill_range_c (T &xs, size_t num_elements)
| Loads elements from type U before inserting to xs.
std::enable_if< detail::is_iterable< T >::value &&!detail::has_serialize< T >::value &&!detail::is_inspectable< serializer, T >::value, error >::type | apply (T &xs)
| Applies this processor to a sequence of values.
std::enable_if< detail::is_serializable< T >::value, error >::type | apply (std::array< T, S > &xs)
| Applies this processor to an array.
std::enable_if< detail::is_serializable< T >::value, error >::type | apply (T(&xs)[S])
| Applies this processor to an array.
std::enable_if< detail::is_serializable< typenamestd::remove_const< F >::type >::value &&detail::is_serializable< S >::value, error >::type | apply (std::pair< F, S > &xs)
std::enable_if< detail::conjunction< detail::is_serializable< Ts >::value... >::value, error >::type | apply (std::tuple< Ts... > &xs)
std::enable_if<!std::is_empty< T >::value &&detail::has_serialize< T >::value, error >::type | apply (T &x)
std::enable_if< std::is_integral< Rep >::value, error >::type | apply (std::chrono::duration< Rep, Period > &x)
std::enable_if< std::is_floating_point< Rep >::value, error >::type | apply (std::chrono::duration< Rep, Period > &x)
error | apply (std::chrono::time_point< Clock, Duration > &t)
std::enable_if< detail::is_inspectable< serializer, T >::value &&!detail::has_serialize< T >::value, decltype(inspect(std::declval< serializer & >(), std::declval< T & >()))>::type | apply (T &x)
error | operator() ()
error | operator() (meta::save_callback_t< F > x, Ts &&... xs)
error | operator() (meta::load_callback_t< F > x, Ts &&... xs)
error | operator() (const meta::annotation &, Ts &&... xs)
std::enable_if< is_allowed_unsafe_message_type< T >::value, error >::type | operator() (const T &, Ts &&... xs)
std::enable_if<!meta::is_annotation< T >::value &&!is_allowed_unsafe_message_type< T >::value, error >::type | operator() (T &&x, Ts &&... xs)

## Protected Member Functions

template<class T>
error | varbyte_encode (T x)
error | apply_impl (int8_t &x) override
error | apply_impl (uint8_t &x) override
error | apply_impl (int16_t &x) override
error | apply_impl (uint16_t &x) override
error | apply_impl (int32_t &x) override
error | apply_impl (uint32_t &x) override
error | apply_impl (int64_t &x) override
error | apply_impl (uint64_t &x) override
error | apply_impl (float &x) override
error | apply_impl (double &x) override
error | apply_impl (long double &x) override
error | apply_impl (std::string &x) override
error | apply_impl (std::u16string &x) override
error | apply_impl (std::u32string &x) override
template<class T>
error | apply_int (T x)

## Additional Inherited Members

Public Types inherited from caf::serializer
using | super = data_processor<serializer>
using | is_saving = std::true_type
using | is_loading = std::false_type
Public Types inherited from caf::data_processor< serializer >
using | result_type
| Return type for operator().
using | builtin_t
| List of builtin types for data processors.
Static Public Member Functions inherited from caf::data_processor< serializer >
static error | apply_atom_constant (D &self, atom_constant< V > &)
static std::enable_if< D::reads_state &&!detail::is_byte_sequence< T >::value, error >::type | apply_sequence (D &self, T &xs)
static std::enable_if<!D::reads_state &&!detail::is_byte_sequence< T >::value, error >::type | apply_sequence (D &self, T &xs)
static std::enable_if< D::reads_state &&detail::is_byte_sequence< T >::value, error >::type | apply_sequence (D &self, T &xs)
static std::enable_if<!D::reads_state &&detail::is_byte_sequence< T >::value, error >::type | apply_sequence (D &self, T &xs)
Static Public Attributes inherited from caf::serializer
static constexpr bool | reads_state = true
static constexpr bool | writes_state = false

## Detailed Description

template<class Streambuf>
class caf::stream_serializer< Streambuf >

Implements the serializer interface with a binary serialization protocol.

## Member Function Documentation

## apply_impl() [1/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | double & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [2/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | float & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [3/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | int16_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [4/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | int32_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [5/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | int64_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [6/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | int8_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [7/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | long double & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [8/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | std::string & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [9/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | std::u16string & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [10/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | std::u32string & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [11/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | uint16_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [12/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | uint32_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [13/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | uint64_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_impl() [14/14]

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_impl | ( | uint8_t & | x | ) |

override protected virtual

Implements caf::data_processor< serializer >.

## apply_raw()

template<class Streambuf>

error caf::stream_serializer< Streambuf >::apply_raw | ( | size_t | num_bytes,
|  | void * | data )

override virtual

Applies this processor to a raw block of data of size num_bytes.

Implements caf::data_processor< serializer >.

## begin_object()

template<class Streambuf>

error caf::stream_serializer< Streambuf >::begin_object | ( | uint16_t & | typenr,
|  | std::string & | name )

override virtual

Begins processing of an object.

Saves the type information to the underlying storage when in saving mode, otherwise extracts them and sets both arguments accordingly.

Implements caf::data_processor< serializer >.

## begin_sequence()

template<class Streambuf>

error caf::stream_serializer< Streambuf >::begin_sequence | ( | size_t & | num | ) |

override virtual

Begins processing of a sequence.

Saves the size to the underlying storage when in saving mode, otherwise sets num accordingly.

Implements caf::data_processor< serializer >.

## end_object()

template<class Streambuf>

error caf::stream_serializer< Streambuf >::end_object | ( |  | ) |

override virtual

Ends processing of an object.

Implements caf::data_processor< serializer >.

## end_sequence()

template<class Streambuf>

error caf::stream_serializer< Streambuf >::end_sequence | ( |  | ) |

override virtual

Ends processing of a sequence.

Implements caf::data_processor< serializer >.

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

- /build/actor-framework-Z9pIPl/actor-framework-0.17.6/libcaf_core/caf/stream_serializer.hpp