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

◆ on_tick()

HookId 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:63
Base context class for node callbacks.
Definition Node.hpp:53
Returns
Id of the registration, usable with unhook(). A callback equivalent to one already registered is not added again and the existing id is returned.

Reimplemented from MayaFlux::Nodes::Node.

Definition at line 103 of file NodeChain.hpp.

104 {
105 return m_nodes.empty() ? 0 : m_nodes.back()->on_tick(callback);
106 }
PickCallback callback
Definition Picker.cpp:22
std::vector< std::shared_ptr< Node > > m_nodes

References callback.