MIRA
Static Public Member Functions | Protected Types | Protected Member Functions | List of all members
SerializerFormatMixin< BinaryStream, 2, Buffered, StreamType > Class Template Reference

#include <serialization/BinarySerializer.h>

Static Public Member Functions

static uint8 getSerializerFormatVersion ()
 
static size_t formatVersionOverhead ()
 Overhead 3 bytes with each serialize(). More...
 

Protected Types

typedef ConcreteBinarySerializer< BinaryStream, 2, Buffered > Serializer
 
typedef boost::mpl::bool_< true > requireReflectBarriers
 
typedef std::tuple< typename StreamType::pos_type, bool, const char * > ReflectState
 
typedef serialization::VersionType VersionType
 

Protected Member Functions

 SerializerFormatMixin ()
 
template<typename T >
bool writeFormatVersion (T &value, bool enableTypeCheck, StreamType &stream)
 Write the format version number into the binary output. More...
 
ReflectState insertVersionPlaceholder (const char *context, Serializer &serializer, StreamType &stream)
 Put a dummy version in the binary output as placeholder, memorize the position for later when (if) the reflected object will tell us its actual version. More...
 
template<typename T >
void writeVersion (VersionType version, Serializer &serializer, StreamType &stream)
 Write version value to version placeholder position. More...
 
void restoreVersionPtr (const ReflectState &prev)
 Restore a previous version placeholder position. More...
 

Member Typedef Documentation

◆ Serializer

typedef ConcreteBinarySerializer<BinaryStream, 2, Buffered> Serializer
protected

◆ requireReflectBarriers

typedef boost::mpl::bool_<true> requireReflectBarriers
protected

◆ ReflectState

typedef std::tuple<typename StreamType::pos_type, bool, const char*> ReflectState
protected

◆ VersionType

Constructor & Destructor Documentation

◆ SerializerFormatMixin()

SerializerFormatMixin ( )
inlineprotected

Member Function Documentation

◆ getSerializerFormatVersion()

static uint8 getSerializerFormatVersion ( )
inlinestatic

◆ formatVersionOverhead()

static size_t formatVersionOverhead ( )
inlinestatic

Overhead 3 bytes with each serialize().

◆ writeFormatVersion()

bool writeFormatVersion ( T &  value,
bool  enableTypeCheck,
StreamType &  stream 
)
inlineprotected

Write the format version number into the binary output.

◆ insertVersionPlaceholder()

ReflectState insertVersionPlaceholder ( const char *  context,
Serializer serializer,
StreamType &  stream 
)
inlineprotected

Put a dummy version in the binary output as placeholder, memorize the position for later when (if) the reflected object will tell us its actual version.

Should be called at the start of an object, before calling its reflect() method. Returns the previously memorized placeholder position, so it can be restored after reflecting the object.

◆ writeVersion()

void writeVersion ( VersionType  version,
Serializer serializer,
StreamType &  stream 
)
inlineprotected

Write version value to version placeholder position.

◆ restoreVersionPtr()

void restoreVersionPtr ( const ReflectState prev)
inlineprotected

Restore a previous version placeholder position.

Should be called when done with reflecting an object (possibly returning to its parent).


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