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

#include <distributed_graph.h>

Static Public Member Functions

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

Detailed Description

template<typename T>
class nlohmann::adl_serializer< fpmas::api::graph::DistributedGraph< T > >

Defines Json serialization rules for generic fpmas::api::graph::DistributedGraph instances.

This notably enables the usage of fpmas::io::Breakpoint with fpmas::api::graph::DistributedGraph instances.

Member Function Documentation

◆ to_json()

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

Serializes graph to the json j.

Parameters
jjson output
graphgraph to serialize

◆ from_json()

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

Unserializes the json j into the specified graph.

Nodes and edges read from the Json file are imported into the graph, without altering the previous state of the input graph. So, depending on the desired behavior, calling graph.clear() might be required before loading data into it.

Parameters
jjson input
graphoutput graph

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