![]() |
fpmas 1.5
|
#include <model.h>
Static Public Member Functions | |
| static void | to_json (json &j, const fpmas::api::model::AgentPtr &pointer) |
| static fpmas::api::model::AgentPtr | from_json (const json &j) |
fpmas::api::model::AgentPtr nlohmann::json serialization rules declaration.
to_json and from_json methods must be defined by the user at compile time, depending on its own Agent types, using the FPMAS_JSON_SET_UP() macro, that must be called from a source file. Otherwise, linker errors will be thrown.
|
static |
|
static |
Unserializes an Agent from the specified JSON j.
The built Agent is dynamically allocated, but is automatically managed by the fpmas::api::model::AgentPtr wrapper.
Since Agent is polymorphic, the concrete type that should be instantiated from the input json j is determined at runtime.
| j | input json |
j, wrapped in an fpmas::api::model::AgentPtr instance