dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Graph::Exporter::Json Class Reference

Export a dfx::Graph::Controller as a JSON document. More...

#include <dfx-graph/exporter/Json.hpp>

Public Member Functions

 Json (Controller const &graph)
 Construct a JSON exporter for a given graph controller.
nlohmann::json process () const
 Generate a JSON representation of the graph.

Detailed Description

Export a dfx::Graph::Controller as a JSON document.

The exporter references the provided graph controller; it does not take ownership and assumes the controller outlives the exporter instance.

Typicall usage:

auto const json = dfx::Graph::Exporter::Json(graph).process();
Export a dfx::Graph::Controller as a JSON document.
Definition Json.hpp:35
nlohmann::json process() const
Generate a JSON representation of the graph.
Note
This class is a pure formatter: it does not perform I/O.

Constructor & Destructor Documentation

◆ Json()

dfx::Graph::Exporter::Json::Json ( Controller const & graph)

Construct a JSON exporter for a given graph controller.

Parameters
graphGraph controller to export (must outlive this object).

Member Function Documentation

◆ process()

nlohmann::json dfx::Graph::Exporter::Json::process ( ) const

Generate a JSON representation of the graph.

Output schema (high level):

{
"nodes": [
{ "name": "...", "type": "...", "config": { ... } }
],
"channels": [
{ "from": "node.port", "to": "node.port" }
]
}
Returns
A JSON object describing the graph.

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