MnaParamTree
Namespace: MNALIB · Library: MNA Library
#include <mna/mna_param_tree.h>
class MNALIB::MnaParamTree
Hierarchical parameter store for the MNA graph.
Each parameter has a path ("nodeId/attrKey") and an optional binding — a formula that recomputes the value whenever a trigger condition is met.
Path-keyed parameter store with formula-driven dynamic bindings.
src/examples/ex_mna/main.cpp
graph.paramTree.setParam("shift/offset", 0.5);
MnaParamBinding binding;
binding.targetPath = "scale/gain";
binding.expression = "clamp(ref('source::out') * 2, 0, 5)"; // evaluated against node results
binding.trigger = "on_change";
graph.paramTree.addBinding(binding);
Public Methods
MnaParamTree()
setParam(path, value)
param(path)
hasParam(path)
allPaths()
addBinding(binding)
removeBinding(targetPath)
bindings()
hasBinding(targetPath)
evaluate(results)
Evaluate all bindings whose trigger condition is met.
Parameters:
- results : const QMap< QString, QVariant > & Map of nodeId::portName → data (from execution context).
Returns:
- QStringList — Paths whose values changed.
evaluateExpression(expr, results)
Evaluate a single expression in the current context.
Parameters:
-
expr : const QString & Expression string.
-
results : const QMap< QString, QVariant > & Map of nodeId::portName → data (from execution context).
Returns:
- QVariant — Computed value.
toJson()
Static Methods
fromJson(obj)
Example
- Full source:
src/examples/ex_mna/main.cpp - Build target:
ex_mna(runs under CTest)
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>