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

◆ notify_tick()

void MayaFlux::Nodes::Generator::Counter::notify_tick ( double  value)
overrideprotectedvirtual

Notifies all registered callbacks with the current context.

Parameters
valueThe current sample value

This method is called by the node implementation when a new output value is produced. It creates a context object using create_context(), then calls all registered callbacks with that context.

For unconditional callbacks (registered with on_tick()), the callback is always called. For conditional callbacks (registered with on_tick_if()), the callback is called only if its condition returns true.

Node implementations should call this method at appropriate points in their processing flow to trigger callbacks.

Implements MayaFlux::Nodes::Node.

Definition at line 115 of file Counter.cpp.

116{
118 auto& ctx = get_last_context();
119
120 m_callbacks.fire(ctx);
123 if (m_wrapped) {
125 }
126 for (const auto& entry : m_count_callbacks.snapshot()) {
127 if (m_count == static_cast<uint32_t>(entry.params[0])) {
128 entry.hook(ctx);
129 }
130 }
131}
glm::vec3 value
void update_context(double value) override
Updates the context object for callbacks.
Definition Counter.cpp:133
NodeContext & get_last_context() override
Gets the last created context object.
Definition Generator.cpp:37
void fire(NodeContext &ctx) const
Calls every entry whose condition, if any, holds.
Definition NodeUtils.cpp:68
HookList m_conditional_callbacks
Hooks fired on a tick only while their condition holds.
Definition Node.hpp:485
HookList m_callbacks
Hooks fired on every tick.
Definition Node.hpp:478

References MayaFlux::Nodes::HookList::fire(), MayaFlux::Nodes::Generator::Generator::get_last_context(), MayaFlux::Nodes::Node::m_callbacks, MayaFlux::Nodes::Node::m_conditional_callbacks, m_count, m_count_callbacks, m_increment_callbacks, m_wrap_callbacks, m_wrapped, MayaFlux::Nodes::HookList::snapshot(), update_context(), and value.

Referenced by process_sample().

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