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

◆ notify_tick()

void MayaFlux::Nodes::Generator::Stochastics::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 108 of file Stochastic.cpp.

109{
111 for (auto& callback : m_callbacks) {
112 callback(*m_last_context);
113 }
114 for (auto& [callback, condition] : m_conditional_callbacks) {
115 if (condition(*m_last_context)) {
116 callback(*m_last_context);
117 }
118 }
119}
std::unique_ptr< NodeContext > create_context(double value) override
Creates a context object for callbacks.
std::vector< NodeHook > m_callbacks
Collection of standard callback functions.
Definition Node.hpp:416
std::vector< std::pair< NodeHook, NodeCondition > > m_conditional_callbacks
Collection of conditional callback functions with their predicates.
Definition Node.hpp:426
std::unique_ptr< NodeContext > m_last_context
The last context object created for callbacks.
Definition Node.hpp:396

References create_context(), MayaFlux::Nodes::Node::m_callbacks, MayaFlux::Nodes::Node::m_conditional_callbacks, and MayaFlux::Nodes::Node::m_last_context.

Referenced by process_sample().

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