|
C++ Actor Framework 0.19
|
Serializes C++ objects into a sequence of bytes. More...
#include <binary_serializer.hpp>
Inherits caf::save_inspector_base< Subtype >.
Public Types | |
| using | super = save_inspector_base< binary_serializer > |
| using | container_type = byte_buffer |
| using | value_type = std::byte |
Public Member Functions | |
| binary_serializer (actor_system &sys, byte_buffer &buf) noexcept | |
| binary_serializer (execution_unit *ctx, byte_buffer &buf) noexcept | |
| binary_serializer (const binary_serializer &)=delete | |
| binary_serializer & | operator= (const binary_serializer &)=delete |
| execution_unit * | context () const noexcept |
| Returns the current execution unit. | |
| byte_buffer & | buf () noexcept |
| const byte_buffer & | buf () const noexcept |
| size_t | write_pos () const noexcept |
| void | seek (size_t offset) noexcept |
Sets the write position to offset. | |
| void | skip (size_t num_bytes) |
Jumps num_bytes forward. | |
| constexpr bool | begin_object (type_id_t, std::string_view) noexcept |
| constexpr bool | end_object () |
| constexpr bool | begin_field (std::string_view) noexcept |
| bool | begin_field (std::string_view, bool is_present) |
| bool | begin_field (std::string_view, span< const type_id_t > types, size_t index) |
| bool | begin_field (std::string_view, bool is_present, span< const type_id_t > types, size_t index) |
| constexpr bool | end_field () |
| constexpr bool | begin_tuple (size_t) |
| constexpr bool | end_tuple () |
| constexpr bool | begin_key_value_pair () |
| constexpr bool | end_key_value_pair () |
| bool | begin_sequence (size_t list_size) |
| constexpr bool | end_sequence () |
| bool | begin_associative_array (size_t size) |
| bool | end_associative_array () |
| bool | value (std::byte x) |
| bool | value (bool x) |
| bool | value (int8_t x) |
| bool | value (uint8_t x) |
| bool | value (int16_t x) |
| bool | value (uint16_t x) |
| bool | value (int32_t x) |
| bool | value (uint32_t x) |
| bool | value (int64_t x) |
| bool | value (uint64_t x) |
| template<class T > | |
| std::enable_if_t< std::is_integral_v< T >, bool > | value (T x) |
| bool | value (float x) |
| bool | value (double x) |
| bool | value (long double x) |
| bool | value (std::string_view x) |
| bool | value (const std::u16string &x) |
| bool | value (const std::u32string &x) |
| bool | value (span< const std::byte > x) |
| bool | value (const std::vector< bool > &x) |
Static Public Member Functions | |
| static constexpr bool | has_human_readable_format () noexcept |
Serializes C++ objects into a sequence of bytes.
|
noexcept |
Sets the write position to offset.
offset <= buf.size() | void caf::binary_serializer::skip | ( | size_t | num_bytes | ) |
Jumps num_bytes forward.
Resizes the buffer (filling it with zeros) when skipping past the end.