CAF  0.17.6
Public Types | Public Member Functions | Protected Member Functions | List of all members
caf::serializer_impl< Container > Class Template Reference

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

#include <serializer_impl.hpp>

Public Types

using super = serializer
 
using container_type = Container
 
using value_type = typename container_type::value_type
 

Public Member Functions

 serializer_impl (actor_system &sys, container_type &buf)
 
 serializer_impl (execution_unit *ctx, container_type &buf)
 
void seek (size_t offset)
 Sets the write position to given offset. More...
 
void skip (size_t num_bytes)
 Jumps num_bytes forward. More...
 
error begin_object (uint16_t &nr, std::string &name) override
 
error end_object () override
 
error begin_sequence (size_t &list_size) override
 
error end_sequence () override
 
error apply_raw (size_t num_bytes, void *data) override
 
container_type & buf ()
 
const container_type & buf () const
 
size_t write_pos () const noexcept
 

Protected Member Functions

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
 

Detailed Description

template<class Container>
class caf::serializer_impl< Container >

Implements the serializer interface with a binary serialization protocol.

Member Function Documentation

◆ seek()

template<class Container >
void caf::serializer_impl< Container >::seek ( size_t  offset)

Sets the write position to given offset.

Precondition
offset <= buf.size()

◆ skip()

template<class Container >
void caf::serializer_impl< Container >::skip ( size_t  num_bytes)

Jumps num_bytes forward.

Resizes the buffer (filling it with zeros) when skipping past the end.


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