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

◆ safe_remove_callback()

template<typename ContextT >
bool MayaFlux::Nodes::safe_remove_callback ( std::vector< TypedHook< ContextT > > &  callbacks,
const TypedHook< ContextT > &  callback 
)

Removes all callbacks whose target_type() matches that of the supplied callback.

Returns
True if at least one entry was removed.

Definition at line 92 of file NodeUtils.hpp.

94{
95 bool removed = false;
96 auto it = callbacks.begin();
97 while (it != callbacks.end()) {
98 if (it->target_type() == callback.target_type()) {
99 it = callbacks.erase(it);
100 removed = true;
101 } else {
102 ++it;
103 }
104 }
105 return removed;
106}

Referenced by MayaFlux::Nodes::Node::remove_hook(), MayaFlux::Nodes::Generator::Counter::remove_hook(), MayaFlux::Nodes::Generator::Impulse::remove_hook(), and MayaFlux::Nodes::Generator::Phasor::remove_hook().

+ Here is the caller graph for this function: