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

#include <graph.h>

Public Types

typedef PtrWrapper< fpmas::model::GraphCellBase< GraphCellType, Derived > > Ptr
 

Static Public Member Functions

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

Detailed Description

template<typename GraphCellType, typename Derived>
struct fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GraphCellBase< GraphCellType, Derived > > >

Polymorphic GraphCellBase LightSerializer specialization.

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
GraphCellTypefinal fpmas::model::GraphCellBase type to serialize
Derivednext derived class in the polymorphic serialization chain

Member Typedef Documentation

◆ Ptr

template<typename GraphCellType , typename Derived >
typedef PtrWrapper<fpmas::model::GraphCellBase<GraphCellType, Derived> > fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GraphCellBase< GraphCellType, Derived > > >::Ptr

Pointer wrapper to a polymorphic SpatialAgentBase.

Member Function Documentation

◆ size()

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

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

◆ to_datapack()

template<typename GraphCellType , typename Derived >
static void fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GraphCellBase< GraphCellType, Derived > > >::to_datapack ( LightObjectPack pack,
const Ptr ptr 
)
inlinestatic

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

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

Parameters
packdestination LightObjectPack
ptragent pointer to serialize

◆ from_datapack()

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

Unserializes a polymorphic GraphCellBase from the specified ObjectPack.

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

Parameters
packsource LightObjectPack
Returns
dynamically allocated Derived instance, unserialized from pack

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