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

◆ conditional_callback_exists()

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

Checks if a condition function already exists in a collection of conditional callbacks.

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

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

Definition at line 17 of file NodeUtils.cpp.

18{
19 return std::ranges::any_of(callbacks,
20 [&callback](const std::pair<NodeHook, NodeCondition>& pair) {
21 return pair.second.target_type() == callback.target_type();
22 });
23}