C++ Actor Framework 0.19
|
Technology-independent serialization interface. More...
#include <serializer.hpp>
Public Types | |
using | super = save_inspector_base< serializer > |
Public Member Functions | |
serializer (actor_system &sys) noexcept | |
serializer (execution_unit *ctx=nullptr) noexcept | |
auto | context () const noexcept |
bool | has_human_readable_format () const noexcept |
virtual bool | begin_object (type_id_t type, std::string_view name)=0 |
Begins processing of an object. | |
virtual bool | end_object ()=0 |
Ends processing of an object. | |
virtual bool | begin_field (std::string_view)=0 |
virtual bool | begin_field (std::string_view name, bool is_present)=0 |
virtual bool | begin_field (std::string_view name, span< const type_id_t > types, size_t index)=0 |
virtual bool | begin_field (std::string_view name, bool is_present, span< const type_id_t > types, size_t index)=0 |
virtual bool | end_field ()=0 |
virtual bool | begin_tuple (size_t size)=0 |
Begins processing of a tuple. | |
virtual bool | end_tuple ()=0 |
Ends processing of a tuple. | |
virtual bool | begin_key_value_pair () |
Begins processing of a tuple with two elements, whereas the first element represents the key in an associative array. | |
virtual bool | end_key_value_pair () |
Ends processing of a key-value pair after both values were written. | |
virtual bool | begin_sequence (size_t size)=0 |
Begins processing of a sequence. Saves the size to the underlying storage. | |
virtual bool | end_sequence ()=0 |
Ends processing of a sequence. | |
virtual bool | begin_associative_array (size_t size) |
Begins processing of an associative array (map). | |
virtual bool | end_associative_array () |
Ends processing of an associative array (map). | |
virtual bool | value (std::byte x)=0 |
Adds x to the output. | |
virtual bool | value (bool x)=0 |
Adds x to the output. | |
virtual bool | value (int8_t x)=0 |
Adds x to the output. | |
virtual bool | value (uint8_t x)=0 |
Adds x to the output. | |
virtual bool | value (int16_t x)=0 |
Adds x to the output. | |
virtual bool | value (uint16_t x)=0 |
Adds x to the output. | |
virtual bool | value (int32_t x)=0 |
Adds x to the output. | |
virtual bool | value (uint32_t x)=0 |
Adds x to the output. | |
virtual bool | value (int64_t x)=0 |
Adds x to the output. | |
virtual bool | value (uint64_t x)=0 |
Adds x to the output. | |
template<class T > | |
std::enable_if_t< std::is_integral_v< T >, bool > | value (T x) |
Adds x to the output. | |
virtual bool | value (float x)=0 |
Adds x to the output. | |
virtual bool | value (double x)=0 |
Adds x to the output. | |
virtual bool | value (long double x)=0 |
Adds x to the output. | |
virtual bool | value (std::string_view x)=0 |
Adds x to the output. | |
virtual bool | value (const std::u16string &x)=0 |
Adds x to the output. | |
virtual bool | value (const std::u32string &x)=0 |
Adds x to the output. | |
virtual bool | value (span< const std::byte > x)=0 |
Adds x as raw byte block to the output. | |
virtual bool | list (const std::vector< bool > &xs) |
Adds each boolean in xs to the output. | |
Protected Attributes | |
execution_unit * | context_ |
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. | |
Technology-independent serialization interface.
|
virtual |
Begins processing of an associative array (map).
begin_sequence(size)
. Reimplemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
virtual |
Begins processing of a tuple with two elements, whereas the first element represents the key in an associative array.
begin_tuple(2)
. Reimplemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Begins processing of an object.
May save the type information to the underlying storage to allow a deserializer to retrieve and check the type information for data formats that provide deserialization.
Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Begins processing of a sequence. Saves the size to the underlying storage.
Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Begins processing of a tuple.
Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
virtual |
Ends processing of an associative array (map).
end_sequence()
. Reimplemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
virtual |
Ends processing of a key-value pair after both values were written.
end_tuple()
. Reimplemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Ends processing of an object.
Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Ends processing of a sequence.
Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Ends processing of a tuple.
Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
virtual |
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.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
as raw byte block to the output.
x | The byte sequence. |
sec::success
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
std::enable_if_t< std::is_integral_v< T >, bool > caf::serializer::value | ( | T | x | ) |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.
|
pure virtual |
Adds x
to the output.
x | A value for a builtin type. |
true
on success, false
otherwise. Implemented in caf::config_value_writer, caf::json_builder, and caf::json_writer.