Workflows
These examples combine the native DIP calls into common tasks. The detailed pages cover query syntax, ownership rules, persistence formats, and generated outputs.
Load a project and read a value
Load a reusable project, evaluate it, and inspect a known path:
#include <snt/dip/dip.h>
snt::dip::DIP parser;
parser.add_project("DIPfile");
snt::dip::Environment env = parser.parse();
double speed = env["physics.speed"].as<double>();
std::string units = env["physics.speed"].units();
See DIPfile projects for the manifest format and Parsing and environments for direct source registration.
Apply an override before evaluation
Register an override before calling parse() so dependent values use the
replacement:
snt::dip::DIP parser;
parser.add_project("DIPfile");
parser.add_override_string("simulation.resolution = 1024\n");
snt::dip::Environment env = parser.parse();
int resolution = env["simulation.resolution"].as<int>();
int cells = env["simulation.cells"].as<int>();
The target must exist and the replacement must satisfy its type, units, and constraints. See Overriding initial values for inline and file-based overrides and their provenance behavior.
Discover and inspect nodes
Use an inspector when the path is not known in advance:
#include <snt/dip/inspect/inspector.h>
snt::dip::Inspector view{env};
snt::dip::TagFilter filter;
filter.all = {"export"};
for (const auto& node : view.select("?physics.", filter))
std::cout << node->path.name << ": " << node->to_string() << "\n";
See Inspection for descriptions, previews, table inspection, provenance, and dependency graphs.
Persist, export, or report
An evaluated environment can be reused without parsing the original inputs:
env.save("run.diph5");
env.generate(snt::dip::ExportFormat::CPP, "parameters.hpp");
See Environment persistence for the DIPH5 contract, Static parameter generation for export formats, and C++ report generation for report output.
Compare evaluated environments
Load two DIPH5 snapshots and compare their effective values or complete evaluated state:
#include <snt/dip/comparison.h>
snt::dip::ComparisonOptions options;
options.scope = snt::dip::ComparisonScope::Effective;
auto changes = snt::dip::compare_diph5(
"before.diph5", "run.diph5", options);
Use the effective scope for values that affect the result, or the full scope when changes to declarations and metadata also matter. See DIPH5 comparison for scope and array-difference semantics.