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

#include <grid.h>

Public Types

typedef PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, 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 &agent)
 
static Ptr from_datapack (const LightObjectPack &pack)
 

Detailed Description

template<typename AgentType, typename CellType, typename Derived>
struct fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >

LightSerializer specialization for an fpmas::model::GridAgent

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
AgentTypefinal fpmas::api::model::GridAgent type to serialize
CellTypetype of cells used by the spatial model
Derivednext derived class in the polymorphic serialization chain

Member Typedef Documentation

◆ Ptr

template<typename AgentType , typename CellType , typename Derived >
typedef PtrWrapper<fpmas::model::GridAgent<AgentType, CellType, Derived> > fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >::Ptr

Pointer wrapper to a polymorphic GridAgent.

Member Function Documentation

◆ size()

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

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

◆ to_datapack()

template<typename AgentType , typename CellType , typename Derived >
static void fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >::to_datapack ( LightObjectPack pack,
const Ptr agent 
)
inlinestatic

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

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

Parameters
packdestination LightObjectPack
agentgrid agent to serialize

◆ from_datapack()

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

Unserializes a polymorphic GridAgent from the specified LightObjectPack.

Effectively calls LightSerializer<fpmas::api::utils::PtrWrapper<Derived>>::from_datapack(), without extracting any GridAgent 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: