fpmas 1.5
Static Public Member Functions | List of all members
nlohmann::adl_serializer< fpmas::api::graph::LocationManager< T > > Struct Template Reference

#include <location_manager.h>

Static Public Member Functions

static void to_json (json &j, const fpmas::api::graph::LocationManager< T > &location_manager)
 
static void from_json (const json &j, fpmas::api::graph::LocationManager< T > &location_manager)
 

Detailed Description

template<typename T>
struct nlohmann::adl_serializer< fpmas::api::graph::LocationManager< T > >

Defines json serialization rules for generic fpmas::api::graph::LocationManager instances.

Notice that it is assumed that the internal state of a LocationManager is defined only by the location of its managed nodes. In consequence, the LocationManager::getLocalNodes() and LocationManager::getDistantNodes() lists for example are not considered by the serialization process. It is the responsibility of the DistributedGraph to call LocationManager::setLocal() and LocationManager::setDistant() methods accordingly when the DistributedGraph is unserialized.

Member Function Documentation

◆ to_json()

template<typename T >
static void nlohmann::adl_serializer< fpmas::api::graph::LocationManager< T > >::to_json ( json &  j,
const fpmas::api::graph::LocationManager< T > &  location_manager 
)
inlinestatic

Serializes the location_manager to the json j.

Parameters
jjson output
location_managerlocation manager to serialize

◆ from_json()

template<typename T >
static void nlohmann::adl_serializer< fpmas::api::graph::LocationManager< T > >::from_json ( const json &  j,
fpmas::api::graph::LocationManager< T > &  location_manager 
)
inlinestatic

Unserializes the json j into the specified location_manager.

Managed nodes read from the input json are added to the location_manager, without considering its current state, so clearing the location_manager before loading data into it might be required, depending on the expected behavior.

Parameters
jjson input
location_manageroutput location manager

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