checkpoint::dispatch::Standard struct

Standard traversals for sizing, packing and unpacking a class.

Public static functions

template<typename T, typename SizerT, typename UserTraits, typename... Args>
static auto size(T& target, Args && ... args) -> SerialSizeType
Recursively get the number of bytes to serialize T.
template<typename T, typename FootprinterT, typename UserTraits, typename... Args>
static auto footprint(T& target, Args && ... args) -> SerialSizeType
Recursively get the memory footprint of T.
template<typename T, typename PackerT, typename UserTraits, typename... Args>
static auto pack(T& target, Args && ... args) -> PackerT
Pack target that requires size number of bytes.
template<typename T, typename UnpackerT, typename UserTraits, typename... Args>
static auto unpack(T* mem, Args && ... args) -> T*
Unpack T from packed byte-buffer mem.
template<typename T>
static auto construct(SerialByteType* mem) -> T*
Construct T on allocate memory mem.
template<typename T>
static auto allocate() -> SerialByteType*
Allocate memory for T.

Function documentation

template<typename T, typename SizerT, typename UserTraits, typename... Args>
static SerialSizeType checkpoint::dispatch::Standard::size(T& target, Args && ... args)

Recursively get the number of bytes to serialize T.

Parameters
target in the target to size
args in arguments to the sizer's constructor
Returns the number of bytes

template<typename T, typename FootprinterT, typename UserTraits, typename... Args>
static SerialSizeType checkpoint::dispatch::Standard::footprint(T& target, Args && ... args)

Recursively get the memory footprint of T.

Parameters
target in the target to measure
args in arguments to the footprinter's constructor
Returns memory footprint of T

template<typename T, typename PackerT, typename UserTraits, typename... Args>
static PackerT checkpoint::dispatch::Standard::pack(T& target, Args && ... args)

Pack target that requires size number of bytes.

Parameters
target in the target to pack
args in arguments to the packer's constructor
Returns the packer after packing

template<typename T, typename UnpackerT, typename UserTraits, typename... Args>
static T* checkpoint::dispatch::Standard::unpack(T* mem, Args && ... args)

Unpack T from packed byte-buffer mem.

Parameters
mem in bytes holding a serialized T
args in arguments to the unpacker's constructor
Returns a pointer to an unpacked T

template<typename T>
static T* checkpoint::dispatch::Standard::construct(SerialByteType* mem)

Construct T on allocate memory mem.

Parameters
mem in allocated buffer
Returns constructed pointer to T

template<typename T>
static SerialByteType* checkpoint::dispatch::Standard::allocate()

Allocate memory for T.

Returns allocated buffer