Workflows
These examples show the command facade at the application boundary. The detailed command pages provide the complete argument surface.
The MAT example uses installed public headers. The PUQ and DIPParse
examples use headers under the matching source checkout’s src/snt/api.
In addition to linking snt-api, add that checkout’s src directory to
the consuming target’s include path, for example:
target_include_directories(application PRIVATE /path/to/snt3/src)
See Getting started for a complete installed-package CMake recipe.
Convert a PUQ quantity
Use a PUQ command when the caller wants a formatted result rather than a typed quantity:
#include <string>
#include <snt/api/puq_convert.h>
snt::api::PUQConvert convert("US_mi", "km");
std::string distance = convert.execute();
See PUQ commands for evaluation, inspection, listing, and unit system options.
Evaluate a MAT mixture
MAT commands return typed records while preserving the configure-then-execute lifecycle:
#include <snt/api/mat_eval.h>
snt::api::MATMaterial material("0.965 <H2O> 0.035 <NaCl>");
material.argument_normalization("mass_fraction");
material.argument_mass_density(snt::puq::Quantity(1.02, "g/cm3"));
material.argument_volume(snt::puq::Quantity(1.0, "L"));
const auto result = material.execute();
See MAT commands for element, substance, and material result records and build requirements.
Parse and query DIPL
Register inputs and requests on DIPParse, then execute once:
#include <string>
#include <snt/api/dip_parse.h>
snt::api::DIPParse parse;
parse.argument_add("file", {"config.dip"});
parse.argument_request("build.python");
parse.argument_value("bool");
std::string value = parse.execute();
See DIP commands for persistence, snapshot comparison, semantic JSON, generation, and reports.