fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::json::light_serializer< NodePtrWrapper< T > > Struct Template Reference

#include <distributed_node.h>

Static Public Member Functions

static void to_json (light_json &j, const NodePtrWrapper< T > &node)
 
static void from_json (const light_json &j, NodePtrWrapper< T > &node_ptr)
 

Detailed Description

template<typename T>
struct fpmas::io::json::light_serializer< NodePtrWrapper< T > >

light_serializer specialization for DistributedNode.

Only the id of the node is considered for serialization, and also the node data, that is itself serialized using the light_serializer.

Template Parameters
Ttype of data contained in the DistributedNode

Member Function Documentation

◆ to_json()

template<typename T >
static void fpmas::io::json::light_serializer< NodePtrWrapper< T > >::to_json ( light_json j,
const NodePtrWrapper< T > &  node 
)
inlinestatic

Minimalist serialization rules for a DistributedNode. The weight is notably ignored, and data is serialized using the light_serializer<T> specialization.

Parameters
jlight json output
nodedistributed node to serialize

◆ from_json()

template<typename T >
static void fpmas::io::json::light_serializer< NodePtrWrapper< T > >::from_json ( const light_json j,
NodePtrWrapper< T > &  node_ptr 
)
inlinestatic

Minimalist unserialization rules for a DistributedNode. The returned DistributedNode is dynamically allocated and initialized with an id, and its data is initialized with the value produced by light_serializer<T>::from_json(). Any other field is default initialized (including the weight of the node).

Parameters
jinput json
node_ptrdistributed node output

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