template<typename AgentType, typename CellType, typename Derived>
struct fpmas::io::datapack::Serializer< PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >
Polymorphic GridAgent ObjectPack serializer specialization.
| Serialization Scheme || |-------------------—|| | Derived ObjectPack serialization | GridAgent::locationPoint() | GridAgent::rd() |
The Derived part is serialized using the Serializer<PtrWrapper<Derived>> serialization, that can be defined externally without additional constraint. The input GridAgent pointer is cast to Derived when required to call the proper Serializer specialization.
- Template Parameters
-
| AgentType | final fpmas::api::model::GridAgent type to serialize |
| CellType | type of cells used by the spatial model |
| Derived | next derived class in the polymorphic serialization chain |
template<typename AgentType , typename CellType , typename Derived >
Unserializes a polymorphic GridAgent from the specified ObjectPack.
First, the Derived part, that extends GridAgent by definition, is unserialized from the ObjectPack using the Serializer<fpmas::api::utils::PtrWrapper<Derived> specialization. During this operation, a Derived instance is dynamically allocated, that might leave the GridAgent members undefined. The specific GridAgent member location_point is then initialized from the second ObjectPack field, the internal random number generator from the third, and the unserialized Derived instance is returned in the form of a polymorphic GridAgent pointer.
- Parameters
-
- Returns
- unserialized pointer to a polymorphic
GridAgent