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

#include <spatial_model.h>

Public Types

typedef PtrWrapper< fpmas::model::SpatialAgentBase< SpatialAgentInterface, AgentType, CellType, Derived > > Ptr
 

Static Public Member Functions

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

Detailed Description

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

LightSerializer specialization for an fpmas::model::SpatialAgentBase

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 Agent 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 SpatialAgentInterface , typename AgentType , typename CellType , typename Derived >
typedef PtrWrapper<fpmas::model::SpatialAgentBase<SpatialAgentInterface, AgentType, CellType, Derived> > fpmas::io::datapack::LightSerializer< PtrWrapper< fpmas::model::SpatialAgentBase< SpatialAgentInterface, AgentType, CellType, Derived > > >::Ptr

Pointer wrapper to a polymorphic SpatialAgentBase.

Member Function Documentation

◆ size()

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

Returns the buffer size required to serialize the polymorphic Agent pointed to by ptr to p.

◆ to_datapack()

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

LightObjectPack to_datapack() implementation for an fpmas::model::SpatialAgentBase.

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

Parameters
oobject pack output
agentagent to serialize

◆ from_datapack()

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

LightObjectPack from_datapack() implementation for an fpmas::model::SpatialAgentBase.

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

Parameters
oobject pack input
Returns
dynamically allocated Derived instance, unserialized from j

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