![]() |
fpmas 1.6
|
#include <model.h>
Static Public Member Functions | |
static std::size_t | size (const ObjectPack &p, const AgentPtr &ptr) |
static void | to_datapack (ObjectPack &pack, const AgentPtr &pointer) |
static AgentPtr | from_datapack (const ObjectPack &pack) |
fpmas::api::model::AgentPtr fpmas::io::datapack::Serializer serialization rules declaration.
to_datapack
and from_datapack
methods must be defined by the user at compile time, depending on its own Agent types, using the FPMAS_DATAPACK_SET_UP() macro, that must be called from a source file. Otherwise, linker errors will be thrown.
|
static |
Returns the buffer size required to serialize the polymorphic Agent pointed by ptr
to p
.
|
static |
|
static |
Unserializes an Agent from the specified ObjectPack.
Since Agent is polymorphic, the concrete type that should be instantiated from the input ObjectPack is determined at runtime.
The built Agent is dynamically allocated, but is automatically managed by the fpmas::api::model::AgentPtr wrapper.
pack | source ObjectPack |
pack
, wrapped in an fpmas::api::model::AgentPtr instance