fpmas 1.5
Public Types | Static Public Member Functions | List of all members
fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > > Struct Template Reference

#include <grid.h>

Public Types

typedef PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > Ptr
 

Static Public Member Functions

static std::size_t size (const LightObjectPack &p, const Ptr &ptr)
 
static void to_datapack (LightObjectPack &pack, const Ptr &cell)
 
static Ptr from_datapack (const LightObjectPack &pack)
 

Detailed Description

template<typename GridCellType, typename Derived>
struct fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > >

LightSerializer specialization for an fpmas::model::GridCellBase

The LightSerializer is directly call on the next Derived type: no data is added to / extracted from the current LightObjectPack.

| Serialization Scheme || |-------------------—|| | Derived LightObjectPack serialization |

The Derived part is serialized using the LightSerializer<PtrWrapper<Derived>> serialization, that can be defined externally without additional constraint (and potentially leaves the LightObjectPack empty).

Template Parameters
GridCellTypefinal fpmas::api::model::GridCell type to serialize
Derivednext derived class in the polymorphic serialization chain

Member Typedef Documentation

◆ Ptr

template<typename GridCellType , typename Derived >
typedef PtrWrapper<fpmas::model::GridCellBase<GridCellType, Derived> > fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > >::Ptr

Pointer wrapper to a polymorphic GridCellBase.

Member Function Documentation

◆ size()

template<typename GridCellType , typename Derived >
static std::size_t fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > >::size ( const LightObjectPack p,
const Ptr ptr 
)
inlinestatic

Returns the buffer size required to serialize the polymorphic GridCellBase pointed by ptr into p, i.e. the buffer size required to serialize the Derived part of ptr.

◆ to_datapack()

template<typename GridCellType , typename Derived >
static void fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > >::to_datapack ( LightObjectPack pack,
const Ptr cell 
)
inlinestatic

Serializes the pointer to the polymorphic GridCellBase into the specified LightObjectPack.

Effectively calls LightSerializer<fpmas::api::utils::PtrWrapper<Derived>>::to_datapack(), without adding any GridCellBase specific data to the LightObjectPack.

Parameters
packdestination LightObjectPack
cellgrid cell to serialize

◆ from_datapack()

template<typename GridCellType , typename Derived >
static Ptr fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridCellBase< GridCellType, Derived > > >::from_datapack ( const LightObjectPack pack)
inlinestatic

Unserializes a polymorphic GridCellBase from the specified LightObjectPack.

Effectively calls LightSerializer<fpmas::api::utils::PtrWrapper<Derived>>::from_datapack(), without extracting any GridCellBase specific data from the LightObjectPack.

Parameters
packLightObjectPack
Returns
dynamically allocated Derived instance, unserialized from pack

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