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

◆ callback_pair_exists()

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

Checks if a specific callback and condition pair already exists.

Parameters
callbacksThe collection of conditional callbacks to search
callbackThe callback function to look for
conditionThe condition function to look for
Returns
True if the exact pair exists in the collection, false otherwise

This function checks if a specific combination of callback and condition functions is already registered. It's used to prevent duplicate registrations of the same callback-condition pair.

Definition at line 25 of file NodeUtils.cpp.

26{
27 return std::ranges::any_of(callbacks,
28 [&callback, &condition](const std::pair<NodeHook, NodeCondition>& pair) {
29 return pair.first.target_type() == callback.target_type() && pair.second.target_type() == condition.target_type();
30 });
31}

Referenced by safe_add_conditional_callback().

+ Here is the caller graph for this function: