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

◆ on_tick_if()

void MayaFlux::Nodes::ChainNode::on_tick_if ( const NodeCondition condition,
const NodeHook callback 
)
inlineoverridevirtual

Registers a conditional callback.

Parameters
conditionPredicate that determines when callback should be triggered
callbackFunction to call when condition is met

Registers a callback function that will be called only when the specified condition is met. The condition is evaluated each time the node produces a new output value, and the callback is triggered only if the condition returns true.

This mechanism enables selective monitoring and reaction to specific node states or events, such as threshold crossings or pattern detection.

Example:

node->on_tick_if(
[](NodeContext& ctx) { return ctx.value > 0.8; },
[](NodeContext& ctx) { std::cout << "Threshold exceeded!" << std::endl; }
);
double value
Current sample value.
Definition Node.hpp:40
Base context class for node callbacks.
Definition Node.hpp:30

Reimplemented from MayaFlux::Nodes::Node.

Definition at line 109 of file NodeChain.hpp.

110 {
111 if (!m_nodes.empty())
112 m_nodes.back()->on_tick_if(condition, callback);
113 }
std::vector< std::shared_ptr< Node > > m_nodes