//$$CDS-header$$
-#ifndef __CDS_CONTAINER_SKIP_LIST_SET_RCU_H
-#define __CDS_CONTAINER_SKIP_LIST_SET_RCU_H
+#ifndef CDSLIB_CONTAINER_SKIP_LIST_SET_RCU_H
+#define CDSLIB_CONTAINER_SKIP_LIST_SET_RCU_H
#include <cds/intrusive/skip_list_rcu.h>
#include <cds/container/details/make_skip_list_set.h>
template <typename Q, typename Less>
bool erase_with( Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >());
}
template <typename Q, typename Less, typename Func>
bool erase_with( Q const& key, Less pred, Func f )
{
+ CDS_UNUSED( pred );
return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
[&f]( node_type const& node) { f( node.m_Value ); } );
}
/// Extracts the item from the set with comparing functor \p pred
/**
- The function is an analog of \ref cds_nonintrusive_SkipListSet_rcu_extract "extract(exempt_ptr&, Q const&)"
- but \p pred predicate is used for key comparing.
+ The function is an analog of \p extract(Q const&) but \p pred predicate is used for key comparing.
\p Less has the semantics like \p std::less.
\p pred must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less>
exempt_ptr extract_with( Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return exempt_ptr( base_class::do_extract_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >()));
}
/// Extracts an item with minimal key from the set
/**
- The function searches an item with minimal key, unlinks it,
+ The function searches an item with minimal key, unlinks it,
and returns \ref cds::urcu::exempt_ptr "exempt_ptr" pointer to the item.
If the skip-list is empty the function returns an empty \p exempt_ptr.
/// Extracts an item with maximal key from the set
/**
- The function searches an item with maximal key, unlinks it from the set,
+ The function searches an item with maximal key, unlinks it from the set,
and returns \ref cds::urcu::exempt_ptr "exempt_ptr" pointer to the item.
If the skip-list is empty the function returns an empty \p exempt_ptr.
{
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
/**
template <typename Q, typename Less, typename Func>
bool find_with( Q& val, Less pred, Func f )
{
+ CDS_UNUSED( pred );
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 )
{
+ CDS_UNUSED( pred );
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
template <typename Q, typename Less>
bool find_with( Q const& val, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >());
}
template <typename Q, typename Less>
value_type * get_with( Q const& val, Less pred )
{
+ CDS_UNUSED( pred );
return to_value_ptr( base_class::get_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >() ));
}
}} // namespace cds::container
-#endif // #ifndef __CDS_CONTAINER_SKIP_LIST_SET_RCU_H
+#endif // #ifndef CDSLIB_CONTAINER_SKIP_LIST_SET_RCU_H