fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::datapack::Serializer< BasicObjectPack< S > > Struct Template Reference

#include <datapack.h>

Static Public Member Functions

template<typename PackType >
static std::size_t size (const PackType &, const BasicObjectPack< S > &)
 
template<typename PackType >
static void to_datapack (PackType &parent, const BasicObjectPack< S > &child)
 
template<typename PackType >
static BasicObjectPack< S > from_datapack (const PackType &parent)
 

Detailed Description

template<template< typename, typename > class S>
struct fpmas::io::datapack::Serializer< BasicObjectPack< S > >

Serializer specialization that allows nested BasicObjectPack serialization.

Serialization Scheme
pack.data().size pack.data().buffer

Member Function Documentation

◆ size()

template<template< typename, typename > class S>
template<typename PackType >
static std::size_t fpmas::io::datapack::Serializer< BasicObjectPack< S > >::size ( const PackType &  ,
const BasicObjectPack< S > &   
)
inlinestatic

Returns the buffer size required to serialize a child data pack into any PackType.

Only sizeof(std::size_t) bytes are first allocated, since child might be expanded (with child.expand(N)) during the serialization process between this size() call and the to_datapack() call.

In consequence, the actual child size is considered at the actual to_datapack() call and the parent pack is expanded accordingly.

◆ to_datapack()

template<template< typename, typename > class S>
template<typename PackType >
static void fpmas::io::datapack::Serializer< BasicObjectPack< S > >::to_datapack ( PackType &  parent,
const BasicObjectPack< S > &  child 
)
inlinestatic

Writes child pack to the parent pack buffer.

Parameters
parentdestination BasicObjectPack
childsource BasicObjectPack

◆ from_datapack()

template<template< typename, typename > class S>
template<typename PackType >
static BasicObjectPack< S > fpmas::io::datapack::Serializer< BasicObjectPack< S > >::from_datapack ( const PackType &  parent)
inlinestatic

Reads a BasicObjectPack from the parent pack buffer. The count of bytes read depends on the corresponding to_datapack() operation.

Parameters
parentsource DataPack
Returns
read BasicObjectPack

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