42 template <
typename Value>
43 std::optional<Value>
readParameter(
const String& path,
unsigned int index)
const;
48 return expressionDependencies_;
58 using ParameterValue = std::variant<floatT, intT, String>;
61 using ParameterRead = std::tuple<String, unsigned int, size_t>;
66 mutable std::mutex readMutex_;
67 mutable std::map<ParameterRead, ParameterValue> parameterValues_;
68 mutable std::vector<nt::Unit> expressionDependencies_;
69 mutable std::atomic<bool> readsTime_ =
false;
The world a single expression evaluation reads and writes to.
Definition ExpressionContext.h:28
bool dependsOnTime() const
Returns whether the expression read the scene time during this evaluation.
Definition ExpressionContext.h:55
std::optional< Value > readParameter(const String &path, unsigned int index) const
Returns a parameter's value, evaluated on the first read and reused after.
Definition ExpressionContext.cpp:19
void recordTimeDependency() const
Notes that the expression read the scene time.
Definition ExpressionContext.h:52
const std::vector< nt::Unit > & getExpressionDependencies() const
Every parameter the expression read during this evaluation.
Definition ExpressionContext.h:46
nt::NodeId currentNode() const
The node a relative parameter path resolves against.
Definition ExpressionContext.h:33