Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SolverGraphSerializable.hpp File Reference

Declare a class to register and retrieve nodes and edges from a unique container. More...

Include dependency graph for SolverGraphSerializable.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  shamrock::solvergraph::SolverGraphSerializable

Namespaces

namespace  shamrock
 namespace for the main framework

Functions

void shamrock::solvergraph::to_json (nlohmann::json &j, const SolverGraphSerializable &p)
 Serialize a SolverGraphSerializable to JSON.
void shamrock::solvergraph::from_json (const nlohmann::json &j, SolverGraphSerializable &p)
 Deserialize a SolverGraphSerializable from JSON.

Detailed Description

Declare a class to register and retrieve nodes and edges from a unique container.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file SolverGraphSerializable.hpp.

Function Documentation

◆ from_json()

void shamrock::solvergraph::from_json ( const nlohmann::json & j,
SolverGraphSerializable & p )
inline

Deserialize a SolverGraphSerializable from JSON.

Expects an "edges" object. Each entry is reconstructed via JsonSerializable::from_json and registered under its key. Edge types must already be registered in JsonSerializable_registry.

Population is all-or-nothing: edges are first registered into a temporary graph, and p is only replaced after every edge has been deserialized successfully. On any exception, p is left unchanged.

Definition at line 83 of file SolverGraphSerializable.hpp.

Here is the call graph for this function:

◆ to_json()

void shamrock::solvergraph::to_json ( nlohmann::json & j,
const SolverGraphSerializable & p )
inline

Serialize a SolverGraphSerializable to JSON.

Writes an "edges" object keyed by edge name. Each edge value includes the polymorphic "type" discriminator and fields from JsonSerializable::to_json.

Definition at line 49 of file SolverGraphSerializable.hpp.

Here is the call graph for this function: