template<typename GraphCellType, typename Derived>
struct fpmas::io::datapack::Serializer< PtrWrapper< fpmas::model::GraphCellBase< GraphCellType, Derived > > >
Polymorphic GraphCellBase Serializer specialization.
| Serialization Scheme |
Derived ObjectPack serialization | ReachableCell ObjectPack serialization |
The Derived part is serialized using the Serializer<PtrWrapper<Derived>> serialization, that can be defined externally without additional constraint. The input GraphCellBase pointer is dynamically cast to Derived or ReachableCell when required to call the proper Serializer specialization.
- Template Parameters
-
template<typename GraphCellType , typename Derived >
Unserializes a polymorphic GraphCellBase from the specified ObjectPack.
First, the Derived part, that extends GraphCellBase by definition, is unserialized using the Serializer<fpmas::api::utils::PtrWrapper<Derived> specialization. During this operation, a Derived instance is dynamically allocated, that might leave the GraphCellBase members undefined. The ReachableCell part is then unserialized into this instance, and the final Derived instance is returned in the form of a polymorphic GraphCellBase pointer.
- Parameters
-
- Returns
- unserialized pointer to a polymorphic
GraphCellBase