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

◆ callback_exists()

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

Checks if a callback function already exists in a collection.

Parameters
callbacksThe collection of callback functions to search
callbackThe callback function to look for
Returns
True if the callback exists in the collection, false otherwise

This function compares function pointers to determine if a specific callback is already registered in a collection. It's used to prevent duplicate registrations of the same callback function.

Definition at line 9 of file NodeUtils.cpp.

10{
11 return std::ranges::any_of(callbacks,
12 [&callback](const NodeHook& hook) {
13 return hook.target_type() == callback.target_type();
14 });
15}
std::function< void(NodeContext &)> NodeHook
Callback function type for node processing events.
Definition NodeUtils.hpp:25

Referenced by safe_add_callback().

+ Here is the caller graph for this function: