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

◆ on_tick()

void MayaFlux::Nodes::ChainNode::on_tick ( const NodeHook callback)
inlineoverridevirtual

Registers a callback to be called on each tick.

Parameters
callbackFunction to call with the current node context

Registers a callback function that will be called each time the node produces a new output value. The callback receives a NodeContext object containing information about the node's current state.

This mechanism enables external components to monitor and react to the node's activity without interrupting the processing flow.

Example:

node->on_tick([](NodeContext& ctx) {
std::cout << "Node produced value: " << ctx.value << 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 103 of file NodeChain.hpp.

104 {
105 if (!m_nodes.empty())
106 m_nodes.back()->on_tick(callback);
107 }
std::vector< std::shared_ptr< Node > > m_nodes