{
return find_at( head(), key, intrusive_key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_at( head(), key, intrusive_key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
+ }
+ //@endcond
/// Finds the key \p key and return the item found
/** \anchor cds_nonintrusive_LazyList_hp_get
{
return find_at( head(), key, intrusive_key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_at( head(), key, intrusive_key_comparator(), f );
+ }
+ //@endcond
/// Finds \p key using \p pred predicate for searching
/**
{
return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
+ }
+ //@endcond
/// Finds \p key and return the item found
/** \anchor cds_nonintrusive_MichaelList_hp_get
{
return base_class::find( key, [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); });
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return base_class::find( key, [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
+ }
+ //@endcond
/// Finds \p key using \p pred predicate for searching
/**
return base_class::find_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
[&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return base_class::find_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
+ [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
+ }
+ //@endcond
/// Find \p key
/** \anchor cds_nonintrusive_SkipListSet_find_val
{
return find_at( head(), key, intrusive_key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f ) const
+ {
+ return find_at( head(), key, intrusive_key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f ) const
+ {
+ return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
+ }
+ //@endcond
/// Finds the key \p key and return the item found
/** \anchor cds_nonintrusive_LazyList_rcu_get
{
return find_at( head(), key, intrusive_key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f ) const
+ {
+ return find_at( head(), key, intrusive_key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f ) const
+ {
+ return find_at( head(), key, typename maker::template less_wrapper<Less>::type(), f );
+ }
+ //@endcond
/// Finds the key \p key and return the item found
/** \anchor cds_nonintrusive_MichaelList_rcu_get
{
return bucket( key ).find( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return bucket( key ).find( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return bucket( key ).find_with( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return bucket( key ).find_with( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_nonintrusive_MichaelSet_find_val
{
return bucket( key ).find( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f ) const
+ {
+ return bucket( key ).find( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return bucket( key ).find_with( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f ) const
+ {
+ return bucket( key ).find_with( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_nonintrusive_MichealSet_rcu_find_val
{
return base_class::find( val, [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); });
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& val, Func f )
+ {
+ return base_class::find( val, [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
+ }
+ //@endcond
/// Finds the key \p val using \p pred predicate for searching
/**
return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
[&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
}
-
- /// Find the key \p val
- /** @anchor cds_nonintrusive_SkipListSet_rcu_find_cfunc
-
- The function searches the item with key equal to \p val and calls the functor \p f for item found.
- The interface of \p Func functor is:
- \code
- struct functor {
- void operator()( value_type& item, Q const& val );
- };
- \endcode
- where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
- The functor may change non-key fields of \p item. Note that the functor is only guarantee
- that \p item cannot be disposed during functor is executing.
- The functor does not serialize simultaneous access to the set's \p item. If such access is
- possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
-
- Note the hash functor specified for class \p Traits template parameter
- should accept a parameter of type \p Q that may be not the same as \p value_type.
-
- The function applies RCU lock internally.
-
- The function returns \p true if \p val is found, \p false otherwise.
- */
- template <typename Q, typename Func>
- bool find( Q const& val, Func f )
- {
- return base_class::find( val, [&f]( node_type& node, Q const& v ) { f( node.m_Value, v ); });
- }
-
- /// Finds the key \p val using \p pred predicate for searching
- /**
- The function is an analog of \ref cds_nonintrusive_SkipListSet_rcu_find_cfunc "find(Q const&, Func)"
- but \p pred is used for key comparing.
- \p Less functor has the semantics like \p std::less.
- \p Less must imply the same element order as the comparator used for building the set.
- */
+ //@cond
template <typename Q, typename Less, typename Func>
bool find_with( Q const& val, Less pred, Func f )
{
return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
- [&f]( node_type& node, Q const& v ) { f( node.m_Value, v ); } );
+ [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
}
+ //@endcond
/// Find the key \p val
/** @anchor cds_nonintrusive_SkipListSet_rcu_find_val
{
return find_( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_with_( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_with_( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_nonintrusive_SplitListSet_find_val
{
return find_( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_with_( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_with_( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_nonintrusive_SplitListSet_rcu_find_val
{
return find_at( &m_Head, key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_at( &m_Head, key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_intrusive_LazyList_hp_find_val
and returns \p true if it is found, and \p false otherwise
*/
template <typename Q>
- bool find( Q const & key )
+ bool find( Q const& key )
{
return find_at( &m_Head, key, key_comparator() );
}
{
return find_at( m_pHead, key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_at( m_pHead, key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the \p key using \p pred predicate for searching
/**
{
return find_at( m_pHead, key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_at( m_pHead, key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds the \p key
/** \anchor cds_intrusive_MichaelList_hp_find_val
{
return find_with_( key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_with_( key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key with \p pred predicate for comparing
/**
{
return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@ndcond
/// Finds \p key
/** \anchor cds_intrusive_SkipListSet_hp_find_val
{
return find_at( &m_Head, key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_at( &m_Head, key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_intrusive_LazyList_nogc_find_val
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- value_type * find_with( Q const & key, Less pred )
+ value_type * find_with( Q const& key, Less pred )
{
return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>() );
}
{
return find_at( m_pHead, key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_at( m_pHead, key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_at( m_pHead, key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_at( m_pHead, key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds \p key
/** \anchor cds_intrusive_MichaelList_nogc_find_val
{
return find_at( const_cast<atomic_node_ptr&>(m_pHead), key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f ) const
+ {
+ return find_at( const_cast<atomic_node_ptr&>(m_pHead), key, key_comparator(), f );
+ }
+ //@endcond
/// Finds \p key using \p pred predicate for searching
/**
{
return find_at( const_cast<atomic_node_ptr&>( m_pHead ), key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f ) const
+ {
+ return find_at( const_cast<atomic_node_ptr&>(m_pHead), key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds \p key
/** \anchor cds_intrusive_MichaelList_rcu_find_val
{
return bucket( key ).find( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return bucket( key ).find( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return bucket( key ).find_with( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return bucket( key ).find_with( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_intrusive_MichaelHashSet_hp_find_val
{
return bucket( key ).find( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return bucket( key ).find( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return bucket( key ).find_with( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return bucket( key ).find_with( key, pred, f );
+ }
+ //@endcond
/// Clears the set (non-atomic)
/**
{
return bucket( key ).find( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f ) const
+ {
+ return bucket( key ).find( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return bucket( key ).find_with( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f ) const
+ {
+ return bucket( key ).find_with( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key and return the item found
/** \anchor cds_intrusive_MichaelHashSet_rcu_get
{
return find_with_( key, key_comparator(), f ) != nullptr;
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f ) const
+ {
+ return find_with_( key, key_comparator(), f ) != nullptr;
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for comparing
/**
{
return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), f ) != nullptr;
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f ) const
+ {
+ return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), f ) != nullptr;
+ }
+ //@endcond
/// Finds \p key
/** \anchor cds_intrusive_SkipListSet_nogc_find_val
{
return do_find_with( key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return do_find_with( key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key with comparing functor \p pred
/**
{
return do_find_with( key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return do_find_with( key, cds::opt::details::make_comparator_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds \p key
/** @anchor cds_intrusive_SkipListSet_rcu_find_val
{
return find_( key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_( key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key with \p pred predicate for comparing
/**
{
return find_( key, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_( key, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_intrusive_SplitListSet_hp_find_val
{
return find_( key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_( key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key with \p pred predicate for comparing
/**
{
return find_( key, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_( key, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f );
+ }
+ //@endcond
/// Checks if the set is empty
/**
{
return find_( key, key_comparator(), f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_( key, key_comparator(), f );
+ }
+ //@endcond
/// Finds the key \p key with \p pred predicate for comparing
/**
{
return find_( key, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f );
}
-
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_( key, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_intrusive_SplitListSet_rcu_find_val