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

◆ safe_remove_conditional_callback()

bool MayaFlux::Nodes::safe_remove_conditional_callback ( std::vector< std::pair< NodeHook, NodeCondition > > &  callbacks,
const NodeCondition callback 
)

Safely removes all conditional callbacks with a specific condition.

Parameters
callbacksThe collection of conditional callbacks to remove from
callbackThe condition function to remove
Returns
True if at least one conditional callback was found and removed, false otherwise

This function searches for all conditional callbacks that use the specified condition function and removes them. It's used to unregister conditional callbacks when they're no longer needed.

Definition at line 68 of file NodeUtils.cpp.

69{
70 bool removed = false;
71 auto it = callbacks.begin();
72
73 while (it != callbacks.end()) {
74 if (it->second.target_type() == callback.target_type()) {
75 it = callbacks.erase(it);
76 removed = true;
77 } else {
78 ++it;
79 }
80 }
81
82 return removed;
83}

Referenced by MayaFlux::Nodes::Node::remove_conditional_hook().

+ Here is the caller graph for this function: