fpmas 1.5
Public Types | Static Public Member Functions | List of all members
fpmas::io::json::light_serializer< 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 void to_json (light_json &j, const Ptr &agent)
 
static Ptr from_json (const light_json &j)
 

Detailed Description

template<typename AgentType, typename CellType, typename Derived>
struct fpmas::io::json::light_serializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >

light_serializer specialization for an fpmas::model::GridAgent

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

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 AgentType , typename CellType , typename Derived >
typedef PtrWrapper<fpmas::model::GridAgent<AgentType, CellType, Derived> > fpmas::io::json::light_serializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >::Ptr

Pointer wrapper to a polymorphic GridAgent.

Member Function Documentation

◆ to_json()

template<typename AgentType , typename CellType , typename Derived >
static void fpmas::io::json::light_serializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >::to_json ( light_json j,
const Ptr agent 
)
inlinestatic

light_json to_json() implementation for an fpmas::model::GridAgent.

Effectively calls light_serializer<fpmas::api::utils::PtrWrapper<Derived>>::to_json(), without adding any GridAgent specific data to the light_json j.

Parameters
jjson output
agentgrid agent to serialize

◆ from_json()

template<typename AgentType , typename CellType , typename Derived >
static Ptr fpmas::io::json::light_serializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >::from_json ( const light_json j)
inlinestatic

light_json from_json() implementation for an fpmas::model::GridAgent.

Effectively calls light_serializer<fpmas::api::utils::PtrWrapper<Derived>>::from_json(), without extracting any GridAgent specific data from the light_json j.

Parameters
jjson input
Returns
dynamically allocated Derived instance, unserialized from j

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