libcaf  0.15.0
Public Types | Public Member Functions | Related Functions | List of all members
caf::serializer Class Reference

Technology-independent serialization interface. More...

#include <serializer.hpp>

Inheritance diagram for caf::serializer:
caf::data_processor< serializer > caf::stream_serializer< Streambuf >

Public Types

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 >
enum  builtin
 Lists all types an implementation has to accept as builtin types.
 
using builtin_t = detail::type_list< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, double, long double, std::string, std::u16string, std::u32string >
 

Public Member Functions

 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 (execution_unit *ctx=nullptr)
 
data_processoroperator= (const data_processor &)=delete
 
virtual void begin_object (uint16_t &typenr, std::string &name)=0
 Begins processing of an object. More...
 
virtual void end_object ()=0
 Ends processing of an object.
 
virtual void begin_sequence (size_t &num)=0
 Begins processing of a sequence. More...
 
virtual void end_sequence ()=0
 Ends processing of a sequence.
 
execution_unitcontext ()
 Returns the actor system associated to this data processor.
 
std::enable_if< std::is_floating_point< T >::value >::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 >::type apply (T &x)
 
void apply (std::string &x)
 
void apply (std::u16string &x)
 
void apply (std::u32string &x)
 
void apply (atom_constant< V > &x)
 
std::enable_if< std::is_enum< T >::value &&!detail::has_serialize< T >::value >::type apply (T &x)
 Serializes enums using the underlying type if no user-defined serialization is defined. More...
 
std::enable_if< std::is_empty< T >::value >::type apply (T &)
 Applies this processor to an empty type.
 
void apply (bool &x)
 
std::enable_if< detail::is_iterable< T >::value &&!detail::has_serialize< T >::value >::type apply (T &xs)
 Applies this processor to a sequence of values.
 
std::enable_if< detail::is_serializable< T >::value >::type apply (std::array< T, S > &xs)
 Applies this processor to an array.
 
std::enable_if< detail::is_serializable< T >::value >::type apply (T(&xs)[S])
 Applies this processor to an array.
 
std::enable_if< detail::is_serializable< typename std::remove_const< F >::type >::value &&detail::is_serializable< S >::value >::type apply (std::pair< F, S > &xs)
 
std::enable_if< detail::conjunction< detail::is_serializable< Ts >::value... >::value >::type apply (std::tuple< Ts...> &xs)
 
std::enable_if< !std::is_empty< T >::value &&detail::has_serialize< T >::value >::type apply (T &x)
 
std::enable_if< std::is_integral< Rep >::value >::type apply (std::chrono::duration< Rep, Period > &x)
 
std::enable_if< std::is_floating_point< Rep >::value >::type apply (std::chrono::duration< Rep, Period > &x)
 
virtual void apply_raw (size_t num_bytes, void *data)=0
 Applies this processor to a raw block of data of size num_bytes.
 

Related Functions

(Note that these are not member functions.)

template<class T >
std::enable_if< std::is_same< void, decltype(std::declval< deserializer & >).apply(std::declval< T & >))) >::value, deserializer & >::type operator>> (deserializer &source, T &x)
 Reads x from source.
 

Additional Inherited Members

- Static Public Member Functions inherited from caf::data_processor< serializer >
static void apply_atom_constant (D &self, atom_constant< V > &)
 
static std::enable_if< D::is_saving::value &&!detail::is_byte_sequence< T >::value >::type apply_sequence (D &self, T &xs)
 
static std::enable_if< !D::is_saving::value &&!detail::is_byte_sequence< T >::value >::type apply_sequence (D &self, T &xs)
 
static std::enable_if< D::is_saving::value &&detail::is_byte_sequence< T >::value >::type apply_sequence (D &self, T &xs)
 
static std::enable_if< !D::is_saving::value &&detail::is_byte_sequence< T >::value >::type apply_sequence (D &self, T &xs)
 
- Protected Member Functions inherited from caf::data_processor< serializer >
virtual void apply_builtin (builtin in_out_type, void *in_out)=0
 Applies this processor to a single builtin value.
 

Detailed Description

Technology-independent serialization interface.


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