![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Helper that loads a graph into a Controller from a JSON file or JSON object. More...
#include <dfx-graph/Loader.hpp>
Static Public Member Functions | |
| static LoadingResult | loadFromFile (fs::path const &path, Controller &controller, LoaderOptions const &options={}) |
| Load a graph JSON file into a controller. | |
| static LoadingResult | loadFromJson (nlohmann::json const &json, Controller &controller, LoaderOptions const &options={}) |
| Load a graph from an in-memory JSON object into a controller. | |
Helper that loads a graph into a Controller from a JSON file or JSON object.
Loader builds graph content (nodes and channels) into an existing dfx::Graph::Controller.
The loader is designed to be all-or-nothing for the objects it creates:
This behavior prevents "partial loads" where the controller ends up in a half-built state.
Channels are specified using the string form:
where the from side must reference an output port and the to side must reference an input port.
Since the loader does not collect errors itself, a verification failure will result in an exception from the controller path.
|
static |
Load a graph JSON file into a controller.
This function reads the file, parses it as JSON, and delegates to loadFromJson().
| path | Path to the .dfx JSON file. |
| controller | Target controller to mutate. |
| options | Loader options (rollback behavior is always enabled). |
|
static |
Load a graph from an in-memory JSON object into a controller.
Implementation notes (behavioral contract):
json against the graph schema before mutating the controller.| json | JSON graph document (validated against the graph schema). |
| controller | Target controller to mutate. |
| options | Loader options (rollback behavior is always enabled). |