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

◆ on_tick()

void MayaFlux::Nodes::Node::on_tick ( const NodeHook callback)
virtual

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 in MayaFlux::Nodes::Generator::Logic, and MayaFlux::Nodes::ChainNode.

Definition at line 5 of file Node.cpp.

6{
8}
std::vector< NodeHook > m_callbacks
Collection of standard callback functions.
Definition Node.hpp:416
bool safe_add_callback(std::vector< NodeHook > &callbacks, const NodeHook &callback)
Safely adds a callback to a collection if it doesn't already exist.
Definition NodeUtils.cpp:33

References m_callbacks, and MayaFlux::Nodes::safe_add_callback().

+ Here is the call graph for this function: