SST/macro
Public Types | Public Member Functions | Protected Attributes | List of all members
sprockit::serializer Class Reference

This class is basically a wrapper for objects to declare the order in which their members should be ser/des. More...

#include <serializer.h>

Collaboration diagram for sprockit::serializer:
Collaboration graph

Public Types

enum  SERIALIZE_MODE { SIZER, PACK, UNPACK }
 

Public Member Functions

 serializer ()
 
pvt::ser_packerpacker ()
 
pvt::ser_unpackerunpacker ()
 
pvt::ser_sizersizer ()
 
template<class T >
void size (T &t)
 
template<class T >
void pack (T &t)
 
template<class T >
void unpack (T &t)
 
virtual ~serializer ()
 
SERIALIZE_MODE mode () const
 
void set_mode (SERIALIZE_MODE mode)
 
void reset ()
 
template<typename T >
void primitive (T &t)
 
template<class T , int N>
void array (T arr[N])
 
template<typename T , typename Int >
void binary (T *&buffer, Int &size)
 
template<typename Int >
void binary (void *&buffer, Int &size)
 
void string (std::string &str)
 
void start_packing (char *buffer, size_t size)
 
void start_sizing ()
 
void start_unpacking (char *buffer, size_t size)
 
size_t size () const
 

Protected Attributes

pvt::ser_packer packer_
 
pvt::ser_unpacker unpacker_
 
pvt::ser_sizer sizer_
 
SERIALIZE_MODE mode_
 

Detailed Description

This class is basically a wrapper for objects to declare the order in which their members should be ser/des.

Definition at line 33 of file serializer.h.

Member Enumeration Documentation

Enumerator
SIZER 
PACK 
UNPACK 

Definition at line 36 of file serializer.h.

Constructor & Destructor Documentation

sprockit::serializer::serializer ( )
inline

Definition at line 41 of file serializer.h.

virtual sprockit::serializer::~serializer ( )
inlinevirtual

Definition at line 80 of file serializer.h.

Member Function Documentation

template<class T , int N>
void sprockit::serializer::array ( arr[N])
inline

Definition at line 119 of file serializer.h.

References sprockit::pvt::ser_sizer::add(), memcpy(), mode_, sprockit::pvt::ser_buffer_accessor::next_str(), PACK, packer_, SIZER, sizer_, UNPACK, and unpacker_.

Referenced by sprockit::serialize< T[N]>::operator()().

Here is the call graph for this function:

template<typename T , typename Int >
void sprockit::serializer::binary ( T *&  buffer,
Int size 
)
inline
template<typename Int >
void sprockit::serializer::binary ( void *&  buffer,
Int size 
)
inline
SERIALIZE_MODE sprockit::serializer::mode ( ) const
inline
template<class T >
void sprockit::serializer::pack ( T &  t)
inline
pvt::ser_packer& sprockit::serializer::packer ( )
inline

Definition at line 47 of file serializer.h.

References packer_.

template<typename T >
void sprockit::serializer::primitive ( T &  t)
inline
void sprockit::serializer::reset ( )
inline

Definition at line 94 of file serializer.h.

References packer_, sprockit::pvt::ser_sizer::reset(), sprockit::pvt::ser_buffer_accessor::reset(), sizer_, and unpacker_.

Here is the call graph for this function:

void sprockit::serializer::set_mode ( SERIALIZE_MODE  mode)
inline

Definition at line 89 of file serializer.h.

References mode(), and mode_.

Here is the call graph for this function:

template<class T >
void sprockit::serializer::size ( T &  t)
inline
size_t sprockit::serializer::size ( ) const
inline

Definition at line 218 of file serializer.h.

References mode_, PACK, packer_, sprockit::pvt::ser_sizer::size(), sprockit::pvt::ser_buffer_accessor::size(), SIZER, sizer_, UNPACK, and unpacker_.

Here is the call graph for this function:

pvt::ser_sizer& sprockit::serializer::sizer ( )
inline

Definition at line 57 of file serializer.h.

References sizer_.

void sprockit::serializer::start_packing ( char *  buffer,
size_t  size 
)
inline

Definition at line 200 of file serializer.h.

References sprockit::pvt::ser_buffer_accessor::init(), mode_, PACK, and packer_.

Here is the call graph for this function:

void sprockit::serializer::start_sizing ( )
inline

Definition at line 206 of file serializer.h.

References mode_, sprockit::pvt::ser_sizer::reset(), SIZER, and sizer_.

Here is the call graph for this function:

void sprockit::serializer::start_unpacking ( char *  buffer,
size_t  size 
)
inline

Definition at line 212 of file serializer.h.

References sprockit::pvt::ser_buffer_accessor::init(), mode_, UNPACK, and unpacker_.

Here is the call graph for this function:

void sprockit::serializer::string ( std::string &  str)
template<class T >
void sprockit::serializer::unpack ( T &  t)
inline
pvt::ser_unpacker& sprockit::serializer::unpacker ( )
inline

Definition at line 52 of file serializer.h.

References unpacker_.

Member Data Documentation

SERIALIZE_MODE sprockit::serializer::mode_
protected
pvt::ser_packer sprockit::serializer::packer_
protected

Definition at line 229 of file serializer.h.

Referenced by array(), binary(), pack(), packer(), primitive(), reset(), size(), and start_packing().

pvt::ser_sizer sprockit::serializer::sizer_
protected

Definition at line 231 of file serializer.h.

Referenced by array(), binary(), primitive(), reset(), size(), sizer(), and start_sizing().

pvt::ser_unpacker sprockit::serializer::unpacker_
protected

Definition at line 230 of file serializer.h.

Referenced by array(), binary(), primitive(), reset(), size(), start_unpacking(), unpack(), and unpacker().


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