[draft] implemented container::MultiLevelHashSet
[libcds.git] / cds / container / ellen_bintree_set_rcu.h
index 02baa88318da368f6e66f8f53e17123511fab938..ecf292b2da0b2f7e6b987ba4072e24bf50def86d 100644 (file)
@@ -1,7 +1,7 @@
 //$$CDS-header$$
 
-#ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_RCU_H
-#define __CDS_CONTAINER_ELLEN_BINTREE_SET_RCU_H
+#ifndef CDSLIB_CONTAINER_ELLEN_BINTREE_SET_RCU_H
+#define CDSLIB_CONTAINER_ELLEN_BINTREE_SET_RCU_H
 
 #include <cds/container/details/ellen_bintree_base.h>
 #include <cds/intrusive/ellen_bintree_rcu.h>
@@ -133,6 +133,10 @@ namespace cds { namespace container {
 
         static CDS_CONSTEXPR const bool c_bExtractLockExternal = base_class::c_bExtractLockExternal; ///< Group of \p extract_xxx functions do not require external locking
 
+        //@cond
+        typedef cds::container::ellen_bintree::implementation_tag implementation_tag;
+        //@endcond
+
     protected:
         //@cond
         typedef typename maker::cxx_leaf_node_allocator cxx_leaf_node_allocator;
@@ -147,7 +151,7 @@ namespace cds { namespace container {
         /// pointer to extracted node
         using exempt_ptr = cds::urcu::exempt_ptr < gc, leaf_node, value_type, typename maker::intrusive_traits::disposer,
             cds::urcu::details::conventional_exempt_member_cast < leaf_node, value_type >
-        > ;
+        >;
 
     public:
         /// Default constructor
@@ -196,7 +200,7 @@ namespace cds { namespace container {
             \endcode
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
-            The user-defined functor is called only if the inserting is success. 
+            The user-defined functor is called only if the inserting is success.
 
             RCU \p synchronize() can be called. RCU should not be locked.
         */
@@ -298,6 +302,7 @@ namespace cds { namespace container {
         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< leaf_node, Less, typename maker::value_accessor >());
         }
 
@@ -341,6 +346,7 @@ namespace cds { namespace container {
         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< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node const& node) { f( node.m_Value ); } );
         }
@@ -404,16 +410,16 @@ namespace cds { namespace container {
 
         /// Extracts an item from the set using \p pred for searching
         /**
-            The function is an analog of \ref cds_nonintrusive_EllenBinTreeSet_rcu_extract "extract(exempt_ptr&, Q const&)"
-            but \p pred is used for key compare.
+            The function is an analog of \p extract(Q const&) but \p pred is used for key compare.
             \p Less has the interface like \p std::less and should meet \ref cds_container_EllenBinTreeSet_rcu_less
             "predicate requirements".
             \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& val, Less pred )
+        exempt_ptr extract_with( Q const& key, Less pred )
         {
-            return exempt_ptr( base_class::extract_with_( val,
+            CDS_UNUSED( pred );
+            return exempt_ptr( base_class::extract_with_( key,
                 cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >() ));
         }
 
@@ -468,6 +474,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q& key, Less pred, Func f ) const
         {
+            CDS_UNUSED( pred );
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                 [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); } );
         }
@@ -475,6 +482,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less, typename Func>
         bool find_with( Q const& key, Less pred, Func f ) const
         {
+            CDS_UNUSED( pred );
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
                                           [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } );
         }
@@ -507,6 +515,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less>
         bool find_with( Q const& key, Less pred ) const
         {
+            CDS_UNUSED( pred );
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >());
         }
 
@@ -537,6 +546,7 @@ namespace cds { namespace container {
         template <typename Q, typename Less>
         value_type * get_with( Q const& key, Less pred ) const
         {
+            CDS_UNUSED( pred );
             leaf_node * pNode = base_class::get_with( key,
                 cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >());
             return pNode ? &pNode->m_Value : nullptr;
@@ -599,4 +609,4 @@ namespace cds { namespace container {
     };
 }}  // namespace cds::container
 
-#endif // #ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_RCU_H
+#endif // #ifndef CDSLIB_CONTAINER_ELLEN_BINTREE_SET_RCU_H