MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ notify_tick()

void MayaFlux::Nodes::Generator::Random::notify_tick ( double  value)
overrideprotectedvirtual

Notifies all registered callbacks about a new value.

Parameters
valueThe newly generated value

This method is called internally whenever a new value is generated, creating the appropriate context and invoking all registered callbacks that should receive notification about this value.

Implements MayaFlux::Nodes::Node.

Definition at line 76 of file Nodes/Generators/Random.cpp.

77{
78 update_context(value);
79 auto& ctx = get_last_context();
80
81 for (auto& callback : m_callbacks) {
82 callback(ctx);
83 }
84 for (auto& [callback, condition] : m_conditional_callbacks) {
85 if (condition(ctx)) {
86 callback(ctx);
87 }
88 }
89}
NodeContext & get_last_context() override
Gets the last created context object.
void update_context(double value) override
Updates the context object with the current node state.
std::vector< NodeHook > m_callbacks
Collection of standard callback functions.
Definition Node.hpp:406
std::vector< std::pair< NodeHook, NodeCondition > > m_conditional_callbacks
Collection of conditional callback functions with their predicates.
Definition Node.hpp:416

References get_last_context(), MayaFlux::Nodes::Node::m_callbacks, MayaFlux::Nodes::Node::m_conditional_callbacks, and update_context().

Referenced by process_sample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: