EllenBinTreeMap, EllenBinTreeSet:
authorkhizmax <libcds.dev@gmail.com>
Sun, 30 Aug 2015 09:45:28 +0000 (12:45 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 30 Aug 2015 09:45:28 +0000 (12:45 +0300)
- replaced ensure() with update()
- replaced find( key ) with contains( key )

MapDelOdd MT-test was refactored for EllenBinTreeMap

12 files changed:
cds/container/ellen_bintree_map_rcu.h
cds/container/ellen_bintree_set_rcu.h
cds/container/impl/ellen_bintree_map.h
cds/container/impl/ellen_bintree_set.h
cds/intrusive/ellen_bintree_rcu.h
cds/intrusive/impl/ellen_bintree.h
projects/Win/vc12/unit-map-delodd.vcxproj
tests/unit/map2/map_defs.h
tests/unit/map2/map_delodd.h
tests/unit/map2/map_delodd_ellentree.cpp
tests/unit/map2/map_type_ellen_bintree.h
tests/unit/map2/map_type_skip_list.h

index 3d43f614401ab0fd490f3fda73dc099d2c2982b5..78abba6bf8506c3f4a867fd4ea9519e1750790ed 100644 (file)
@@ -225,19 +225,13 @@ namespace cds { namespace container {
             return false;
         }
 
-        /// Ensures that the \p key exists in the map
+        /// Updates the node
         /**
             The operation performs inserting or changing data with lock-free manner.
 
-            If the \p key not found in the map, then the new item created from \p key
-            is inserted into the map (note that in this case the \p key_type should be
-            constructible from type \p K).
+            If the item \p val is not found in the map, then \p val is inserted iff \p bAllowInsert is \p true.
             Otherwise, the functor \p func is called with item found.
-            The functor \p Func may be a function with signature:
-            \code
-                void func( bool bNew, value_type& item );
-            \endcode
-            or a functor:
+            The functor \p func signature is:
             \code
                 struct my_functor {
                     void operator()( bool bNew, value_type& item );
@@ -246,29 +240,41 @@ namespace cds { namespace container {
 
             with arguments:
             - \p bNew - \p true if the item has been inserted, \p false otherwise
-            - \p item - item of the tree
+            - \p item - item of the map
 
-            The functor may change any fields of the \p item.second that is \p value_type.
+            The functor may change any fields of the \p item.second that is \p mapped_type;
+            however, \p func must guarantee that during changing no any other modifications
+            could be made on this item by concurrent threads.
 
             RCU \p synchronize() method can be called. RCU should not be locked.
 
-            Returns <tt> std::pair<bool, bool> </tt> where \p first is \p true if operation is successfull,
+            Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
+            i.e. the node has been inserted or updated,
             \p second is \p true if new item has been added or \p false if the item with \p key
-            already is in the tree.
+            already exists.
 
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename K, typename Func>
-        std::pair<bool, bool> ensure( K const& key, Func func )
+        std::pair<bool, bool> update( K const& key, Func func, bool bAllowInsert = true )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-            std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, leaf_node& item, leaf_node const& ){ func( bNew, item.m_Value ); }
+            std::pair<bool, bool> res = base_class::update( *pNode,
+                [&func](bool bNew, leaf_node& item, leaf_node const& ){ func( bNew, item.m_Value ); },
+                bAllowInsert
             );
             if ( res.first && res.second )
                 pNode.release();
             return res;
         }
+        //@cond
+        // Deprecated, use update()
+        template <typename K, typename Func>
+        std::pair<bool, bool> ensure( K const& key, Func func )
+        {
+            return update( key, func, true );
+        }
+        //@endcond
 
         /// Delete \p key from the map
         /**\anchor cds_nonintrusive_EllenBinTreeMap_rcu_erase_val
@@ -448,33 +454,48 @@ namespace cds { namespace container {
                 [&f](leaf_node& item, K const& ) { f( item.m_Value );});
         }
 
-        /// Find the key \p key
-        /** \anchor cds_nonintrusive_EllenBinTreeMap_rcu_find_val
-
+        /// Checks whether the map contains \p key
+        /**
             The function searches the item with key equal to \p key
             and returns \p true if it is found, and \p false otherwise.
 
             The function applies RCU lock internally.
         */
         template <typename K>
+        bool contains( K const& key )
+        {
+            return base_class::contains( key );
+        }
+        //@cond
+        // Deprecated, use contains()
+        template <typename K>
         bool find( K const& key )
         {
-            return base_class::find( key );
+            return contains( key );
         }
+        //@endcond
 
-        /// Finds the key \p val using \p pred predicate for searching
+        /// Checks whether the map contains \p key using \p pred predicate for searching
         /**
-            The function is an analog of \ref cds_nonintrusive_EllenBinTreeMap_rcu_find_val "find(K const&)"
-            but \p pred is used for key comparing.
-            \p Less functor has the interface like \p std::less.
-            \p Less must imply the same element order as the comparator used for building the map.
+            The function is similar to <tt>contains( key )</tt> but \p pred is used for key comparing.
+            \p Less functor has the interface like \p std::less and should meet \ref cds_intrusive_EllenBinTree_rcu_less
+            "Predicate requirements".
+            \p Less must imply the same element order as the comparator used for building the set.
         */
         template <typename K, typename Less>
-        bool find_with( K const& key, Less pred )
+        bool contains( K const& key, Less pred )
         {
             CDS_UNUSED( pred );
-            return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >() );
+            return base_class::contains( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >() );
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename K, typename Less>
+        bool find_with( K const& key, Less pred )
+        {
+            return contains( key, pred );
+        }
+        //@endcond
 
         /// Finds \p key and return the item found
         /** \anchor cds_nonintrusive_EllenBinTreeMap_rcu_get
index ecf292b2da0b2f7e6b987ba4072e24bf50def86d..e9ac66f21a15c949a7b3c8ae54cef4c9289ef6bb 100644 (file)
@@ -215,49 +215,53 @@ namespace cds { namespace container {
             return false;
         }
 
-        /// Ensures that the item exists in the set
+        /// Updates the node
         /**
             The operation performs inserting or changing data with lock-free manner.
 
-            If the \p val key not found in the set, then the new item created from \p val
-            is inserted into the set. Otherwise, the functor \p func is called with the item found.
-            The functor \p Func should be a function with signature:
+            If the item \p val is not found in the set, then \p val is inserted into the set
+            iff \p bAllowInsert is \p true.
+            Otherwise, the functor \p func is called with item found.
+            The functor \p func signature is:
             \code
-                void func( bool bNew, value_type& item, const Q& val );
+                void func( bool bNew, value_type& item, value_type& val );
             \endcode
-            or a functor:
-            \code
-                struct my_functor {
-                    void operator()( bool bNew, value_type& item, const Q& val );
-                };
-            \endcode
-
             with arguments:
             - \p bNew - \p true if the item has been inserted, \p false otherwise
             - \p item - item of the set
-            - \p val - argument \p key passed into the \p ensure function
+            - \p val - argument \p val passed into the \p %update() function
 
-            The functor may change non-key fields of the \p item; however, \p func must guarantee
+            The functor can change non-key fields of the \p item; however, \p func must guarantee
             that during changing no any other modifications could be made on this item by concurrent threads.
 
-            RCU \p synchronize() can be called. RCU should not be locked.
+            RCU \p synchronize method can be called. RCU should not be locked.
 
-            Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
-            \p second is true if new item has been added or \p false if the item with \p key
-            already is in the set.
+            Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
+            i.e. the node has been inserted or updated,
+            \p second is \p true if new item has been added or \p false if the item with \p key
+            already exists.
 
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Q, typename Func>
-        std::pair<bool, bool> ensure( const Q& val, Func func )
+        std::pair<bool, bool> update( Q const& val, Func func, bool bAllowInsert = true )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-            std::pair<bool, bool> bRes = base_class::ensure( *sp,
-                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); });
+            std::pair<bool, bool> bRes = base_class::update( *sp,
+                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); },
+                bAllowInsert );
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
         }
+        //@cond
+        // Deprecated, use update()
+        template <typename Q, typename Func>
+        std::pair<bool, bool> ensure( const Q& val, Func func )
+        {
+            return update( val, func true );
+        }
+        //@endcond
 
         /// Inserts data of type \p value_type created in-place from \p args
         /**
@@ -488,36 +492,49 @@ namespace cds { namespace container {
         }
         //@endcond
 
-        /// Find the key \p key
-        /** @anchor cds_nonintrusive_EllenBinTreeSet_rcu_find_val
-
+        /// Checks whether the set contains \p key
+        /**
             The function searches the item with key equal to \p key
             and returns \p true if it is found, and \p false otherwise.
 
-            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 \ref value_type.
-
             The function applies RCU lock internally.
         */
         template <typename Q>
+        bool contains( Q const& key ) const
+        {
+            return base_class::contains( key );
+        }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q>
         bool find( Q const& key ) const
         {
-            return base_class::find( key );
+            return contains( key );
         }
+        //@endcond
 
-        /// Finds the key \p key using \p pred predicate for searching
+        /// Checks whether the set contains \p key using \p pred predicate for searching
         /**
-            The function is an analog of \ref cds_nonintrusive_EllenBinTreeSet_rcu_find_val "find(Q const&)"
-            but \p pred is used for key comparing.
-            \p Less functor has the interface like \p std::less.
+            The function is similar to <tt>contains( key )</tt> but \p pred is used for key comparing.
+            \p Less functor has the interface like \p std::less and should meet \ref cds_intrusive_EllenBinTree_rcu_less
+            "Predicate requirements".
             \p Less must imply the same element order as the comparator used for building the set.
+            \p pred should accept arguments of type \p Q, \p key_type, \p value_type in any combination.
         */
         template <typename Q, typename Less>
-        bool find_with( Q const& key, Less pred ) const
+        bool contains( 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 >());
+            return base_class::contains( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >());
+        }
+        //@cond
+        // DEprecated, use contains()
+        template <typename Q, typename Less>
+        bool find_with( Q const& key, Less pred ) const
+        {
+            return contains( key, pred );
         }
+        //@endcond
 
         /// Finds \p key and return the item found
         /** \anchor cds_nonintrusive_EllenBinTreeSet_rcu_get
index 1c8a3a0156cad13e3077053f088c36481cfc24b3..7aa799cd0768b44383164e299c625cadf0fe6068 100644 (file)
@@ -218,19 +218,13 @@ namespace cds { namespace container {
             return false;
         }
 
-        /// Ensures that the \p key exists in the map
+        /// Updates the node
         /**
             The operation performs inserting or changing data with lock-free manner.
 
-            If the \p key not found in the map, then the new item created from \p key
-            is inserted into the map (note that in this case the \ref key_type should be
-            constructible from type \p K).
+            If the item \p val is not found in the map, then \p val is inserted iff \p bAllowInsert is \p true.
             Otherwise, the functor \p func is called with item found.
-            The functor \p Func may be a function with signature:
-            \code
-                void func( bool bNew, value_type& item );
-            \endcode
-            or a functor:
+            The functor \p func signature is:
             \code
                 struct my_functor {
                     void operator()( bool bNew, value_type& item );
@@ -239,27 +233,39 @@ namespace cds { namespace container {
 
             with arguments:
             - \p bNew - \p true if the item has been inserted, \p false otherwise
-            - \p item - item of the list
+            - \p item - item of the map
 
-            The functor may change any fields of the \p item.second that is \ref value_type.
+            The functor may change any fields of the \p item.second that is \ref mapped_type;
+            however, \p func must guarantee that during changing no any other modifications
+            could be made on this item by concurrent threads.
 
-            Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
-            \p second is true if new item has been added or \p false if the item with \p key
-            already is in the list.
+            Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
+            i.e. the node has been inserted or updated,
+            \p second is \p true if new item has been added or \p false if the item with \p key
+            already exists.
 
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename K, typename Func>
-        std::pair<bool, bool> ensure( K const& key, Func func )
+        std::pair<bool, bool> update( K const& key, Func func, bool bAllowInsert = true )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-            std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, leaf_node& item, leaf_node const& ){ func( bNew, item.m_Value ); }
+            std::pair<bool, bool> res = base_class::update( *pNode,
+                [&func](bool bNew, leaf_node& item, leaf_node const& ){ func( bNew, item.m_Value ); },
+                bAllowInsert
             );
             if ( res.first && res.second )
                 pNode.release();
             return res;
         }
+        //@cond
+        // Deprecated, use update()
+        template <typename K, typename Func>
+        std::pair<bool, bool> ensure( K const& key, Func func )
+        {
+            return update( key, func, true );
+        }
+        //@endcond
 
         /// Delete \p key from the map
         /**\anchor cds_nonintrusive_EllenBinTreeMap_erase_val
@@ -436,31 +442,45 @@ namespace cds { namespace container {
                 [&f](leaf_node& item, K const& ) { f( item.m_Value );});
         }
 
-        /// Find the key \p key
-        /** \anchor cds_nonintrusive_EllenBinTreeMap_find_val
-
+        /// Checks whether the map contains \p key
+        /**
             The function searches the item with key equal to \p key
             and returns \p true if it is found, and \p false otherwise.
         */
         template <typename K>
+        bool contains( K const& key )
+        {
+            return base_class::contains( key );
+        }
+        //@cond
+        // Deprecated, use contains()
+        template <typename K>
         bool find( K const& key )
         {
-            return base_class::find( key );
+            return contains( key );
         }
+        //@endcond
 
-        /// Finds the key \p val using \p pred predicate for searching
+        /// Checks whether the map contains \p key using \p pred predicate for searching
         /**
-            The function is an analog of \ref cds_nonintrusive_EllenBinTreeMap_find_val "find(K const&)"
-            but \p pred is used for key comparing.
+            The function is similar to <tt>contains( key )</tt> but \p pred is used for key comparing.
             \p Less functor has the interface like \p std::less.
-            \p Less must imply the same element order as the comparator used for building the map.
+            \p Less must imply the same element order as the comparator used for building the set.
         */
         template <typename K, typename Less>
-        bool find_with( K const& key, Less pred )
+        bool contains( K const& key, Less pred )
         {
             CDS_UNUSED( pred );
-            return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >() );
+            return base_class::contains( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >() );
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename K, typename Less>
+        bool find_with( K const& key, Less pred )
+        {
+            return contains( key, pred );
+        }
+        //@endcond
 
         /// Finds \p key and returns the item found
         /** @anchor cds_nonintrusive_EllenBinTreeMap_get
index 3eebc06d41156c0aef61886515d64b15a37eaa37..381938fbdfc499c33af93facc00049b289f4c81b 100644 (file)
@@ -210,47 +210,54 @@ namespace cds { namespace container {
             return false;
         }
 
-        /// Ensures that the item exists in the set
+        /// Updates the node
         /**
             The operation performs inserting or changing data with lock-free manner.
 
-            If the \p val key not found in the set, then the new item created from \p val
-            is inserted into the set. Otherwise, the functor \p func is called with the item found.
-            The functor \p Func should be a function with signature:
-            \code
-                void func( bool bNew, value_type& item, const Q& val );
-            \endcode
-            or a functor:
+            If the item \p val is not found in the set, then \p val is inserted into the set
+            iff \p bAllowInsert is \p true.
+            Otherwise, the functor \p func is called with item found.
+            The functor \p func signature is:
             \code
                 struct my_functor {
                     void operator()( bool bNew, value_type& item, const Q& val );
                 };
             \endcode
-
+            with arguments:
             with arguments:
             - \p bNew - \p true if the item has been inserted, \p false otherwise
             - \p item - item of the set
-            - \p val - argument \p key passed into the \p ensure function
+            - \p val - argument \p key passed into the \p %update() function
 
-            The functor may change non-key fields of the \p item; however, \p func must guarantee
+            The functor can change non-key fields of the \p item; however, \p func must guarantee
             that during changing no any other modifications could be made on this item by concurrent threads.
 
-            Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
-            \p second is true if new item has been added or \p false if the item with \p key
-            already is in the set.
+            Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
+            i.e. the node has been inserted or updated,
+            \p second is \p true if new item has been added or \p false if the item with \p key
+            already exists.
 
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Q, typename Func>
-        std::pair<bool, bool> ensure( const Q& val, Func func )
+        std::pair<bool, bool> update( const Q& val, Func func, bool bAllowInsert = true )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-            std::pair<bool, bool> bRes = base_class::ensure( *sp,
-                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); });
+            std::pair<bool, bool> bRes = base_class::update( *sp,
+                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); },
+                bAllowInsert );
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
         }
+        //@cond
+        // Deprecated, use update()
+        template <typename Q, typename Func>
+        std::pair<bool, bool> ensure( const Q& val, Func func )
+        {
+            return update( val, func, true );
+        }
+        //@endcond
 
         /// Inserts data of type \p value_type created in-place from \p args
         /**
@@ -476,34 +483,45 @@ namespace cds { namespace container {
         }
         //@endcond
 
-        /// Find the key \p key
-        /** @anchor cds_nonintrusive_EllenBinTreeSet_find_val
-
+        /// Checks whether the set contains \p key
+        /**
             The function searches the item with key equal to \p key
             and returns \p true if it is found, and \p false otherwise.
-
-            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 \ref value_type.
         */
         template <typename Q>
+        bool contains( Q const & key )
+        {
+            return base_class::contains( key );
+        }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q>
         bool find( Q const & key )
         {
-            return base_class::find( key );
+            return contains( key );
         }
+        //@endcond
 
-        /// Finds the key \p key using \p pred predicate for searching
+        /// Checks whether the set contains \p key using \p pred predicate for searching
         /**
-            The function is an analog of \ref cds_nonintrusive_EllenBinTreeSet_find_val "find(Q const&)"
-            but \p pred is used for key comparing.
+            The function is similar to <tt>contains( key )</tt> but \p pred is used for key comparing.
             \p Less functor has the interface like \p std::less.
             \p Less must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool find_with( Q const& key, Less pred )
+        bool contains( Q const& key, Less pred )
         {
             CDS_UNUSED( pred );
-            return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >());
+            return base_class::contains( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >());
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q, typename Less>
+        bool find_with( Q const& key, Less pred )
+        {
+            return contains( key, pred );
+        }
+        //@endcond
 
         /// Finds \p key and returns the item found
         /** @anchor cds_nonintrusive_EllenBinTreeSet_get
index 0515bb995c0bb61e7ba9da40744060c4f6eea2ee..2f8f2e34924b646b212de48096cf677cce87808f 100644 (file)
@@ -777,20 +777,21 @@ namespace cds { namespace intrusive {
             return true;
         }
 
-        /// Ensures that the \p val exists in the tree
+        /// Updates the node
         /**
             The operation performs inserting or changing data with lock-free manner.
 
-            If the item \p val is not found in the tree, then \p val is inserted into the tree.
+            If the item \p val is not found in the set, then \p val is inserted into the set
+            iff \p bAllowInsert is \p true.
             Otherwise, the functor \p func is called with item found.
-            The functor signature is:
+            The functor \p func signature is:
             \code
                 void func( bool bNew, value_type& item, value_type& val );
             \endcode
             with arguments:
             - \p bNew - \p true if the item has been inserted, \p false otherwise
-            - \p item - item of the tree
-            - \p val - argument \p val passed into the \p ensure function
+            - \p item - item of the set
+            - \p val - argument \p val passed into the \p %update() function
             If new item has been inserted (i.e. \p bNew is \p true) then \p item and \p val arguments
             refer to the same thing.
 
@@ -799,14 +800,15 @@ namespace cds { namespace intrusive {
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
-            Returns <tt>std::pair<bool, bool> </tt> where \p first is \p true if operation is successfull,
+            Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
+            i.e. the node has been inserted or updated,
             \p second is \p true if new item has been added or \p false if the item with \p key
-            already is in the tree.
+            already exists.
 
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Func>
-        std::pair<bool, bool> ensure( value_type& val, Func func )
+        std::pair<bool, bool> update( value_type& val, Func func, bool bAllowInsert = true )
         {
             check_deadlock_policy::check();
 
@@ -830,6 +832,9 @@ namespace cds { namespace intrusive {
                     if ( res.updParent.bits() != update_desc::Clean )
                         help( res.updParent, updRetire );
                     else {
+                        if ( !bAllowInsert )
+                            return std::make_pair( false, false );
+
                         if ( !pNewInternal.get() )
                             pNewInternal.reset( alloc_internal_node() );
 
@@ -850,6 +855,14 @@ namespace cds { namespace intrusive {
 
             return std::make_pair( true, true );
         }
+        //@cond
+        // Deprecated, use update()
+        template <typename Func>
+        std::pair<bool, bool> ensure( value_type& val, Func func )
+        {
+            return update( val, func, true );
+        }
+        //@endcond
 
         /// Unlinks the item \p val from the tree
         /**
@@ -1041,18 +1054,15 @@ namespace cds { namespace intrusive {
             return exempt_ptr( extract_with_( key, pred ));
         }
 
-        /// Finds the key \p key
-        /** @anchor cds_intrusive_EllenBinTree_rcu_find_val
+        /// Checks whether the set contains \p key
+        /**
             The function searches the item with key equal to \p key
             and returns \p true if it is found, and \p false otherwise.
 
-            Note the hash functor specified for class \p Traits template parameter
-            should accept a parameter of type \p Q that can be not the same as \p value_type.
-
             The function applies RCU lock internally.
         */
         template <typename Q>
-        bool find( Q const& key ) const
+        bool contains( Q const& key ) const
         {
             rcu_lock l;
             search_result    res;
@@ -1064,18 +1074,25 @@ namespace cds { namespace intrusive {
             m_Stat.onFindFailed();
             return false;
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q>
+        bool find( Q const& key ) const
+        {
+            return contains( key );
+        }
+        //@endcond
 
-        /// Finds the key \p key with comparing functor \p pred
+        /// Checks whether the set contains \p key using \p pred predicate for searching
         /**
-            The function is an analog of \ref cds_intrusive_EllenBinTree_rcu_find_val "find(Q const&)"
-            but \p pred is used for key compare.
+            The function is similar to <tt>contains( key )</tt> but \p pred is used for key comparing.
             \p Less functor has the interface like \p std::less and should meet \ref cds_intrusive_EllenBinTree_rcu_less
             "Predicate requirements".
-            \p pred must imply the same element order as the comparator used for building the tree.
+            \p Less must imply the same element order as the comparator used for building the set.
             \p pred should accept arguments of type \p Q, \p key_type, \p value_type in any combination.
         */
         template <typename Q, typename Less>
-        bool find_with( Q const& key, Less pred ) const
+        bool contains( Q const& key, Less pred ) const
         {
             CDS_UNUSED( pred );
             typedef ellen_bintree::details::compare<
@@ -1094,6 +1111,14 @@ namespace cds { namespace intrusive {
             m_Stat.onFindFailed();
             return false;
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q, typename Less>
+        bool find_with( Q const& key, Less pred ) const
+        {
+            return contains( key, pred );
+        }
+        //@endcond
 
         /// Finds the key \p key
         /** @anchor cds_intrusive_EllenBinTree_rcu_find_func
index 58c6a6acbc694c97851a53091241be064a9679c5..5428090f4bbcdf7c95fc5b53effd65db78b5b2e0 100644 (file)
@@ -369,20 +369,21 @@ namespace cds { namespace intrusive {
             return true;
         }
 
-        /// Ensures that the \p val exists in the tree
+        /// Updates the node
         /**
             The operation performs inserting or changing data with lock-free manner.
 
-            If the item \p val is not found in the tree, then \p val is inserted into the tree.
+            If the item \p val is not found in the set, then \p val is inserted into the set
+            iff \p bAllowInsert is \p true.
             Otherwise, the functor \p func is called with item found.
-            The functor signature is:
+            The functor \p func signature is:
             \code
                 void func( bool bNew, value_type& item, value_type& val );
             \endcode
             with arguments:
             - \p bNew - \p true if the item has been inserted, \p false otherwise
-            - \p item - an item of the tree
-            - \p val - the argument \p val passed to the \p ensure function
+            - \p item - item of the set
+            - \p val - argument \p val passed into the \p %update() function
             If new item has been inserted (i.e. \p bNew is \p true) then \p item and \p val arguments
             refer to the same thing.
 
@@ -390,13 +391,14 @@ namespace cds { namespace intrusive {
             that during changing no any other modifications could be made on this item by concurrent threads.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
+            i.e. the node has been inserted or updated,
             \p second is \p true if new item has been added or \p false if the item with \p key
-            already is in the tree.
+            already exists.
 
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Func>
-        std::pair<bool, bool> ensure( value_type& val, Func func )
+        std::pair<bool, bool> update( value_type& val, Func func, bool bAllowInsert = true )
         {
             typename gc::Guard guardInsert;
             guardInsert.assign( &val );
@@ -415,6 +417,8 @@ namespace cds { namespace intrusive {
                 }
 
                 if ( res.updGrandParent.bits() == update_desc::Clean && res.updParent.bits() == update_desc::Clean )  {
+                    if ( !bAllowInsert )
+                        return std::make_pair( false, false );
 
                     if ( !pNewInternal.get() )
                         pNewInternal.reset( alloc_internal_node() );
@@ -434,6 +438,14 @@ namespace cds { namespace intrusive {
             m_Stat.onEnsureNew();
             return std::make_pair( true, true );
         }
+        //@cond
+        // Deprecated, us update()
+        template <typename Func>
+        std::pair<bool, bool> ensure( value_type& val, Func func )
+        {
+            return update( val, func, true );
+        }
+        //@endcond
 
         /// Unlinks the item \p val from the tree
         /**
@@ -622,16 +634,13 @@ namespace cds { namespace intrusive {
             return gp;
         }
 
-        /// Finds the key \p key
-        /** @anchor cds_intrusive_EllenBinTree_find_val
+        /// Checks whether the set contains \p key
+        /**
             The function searches the item with key equal to \p key
             and returns \p true if it is found, and \p false otherwise.
-
-            Note the hash functor specified for class \p Traits template parameter
-            should accept a parameter of type \p Q that can be not the same as \p value_type.
         */
         template <typename Q>
-        bool find( Q const& key ) const
+        bool contains( Q const& key ) const
         {
             search_result    res;
             if ( search( res, key, node_compare() )) {
@@ -642,18 +651,23 @@ namespace cds { namespace intrusive {
             m_Stat.onFindFailed();
             return false;
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q>
+        bool find( Q const& key ) const
+        {
+            return contains( key );
+        }
+        //@endcond
 
-        /// Finds the key \p key with comparing functor \p pred
+        /// Checks whether the set contains \p key using \p pred predicate for searching
         /**
-            The function is an analog of \ref cds_intrusive_EllenBinTree_find_val "find(Q const&)"
-            but \p pred is used for key compare.
-            \p Less functor has the interface like \p std::less and should meet \ref cds_intrusive_EllenBinTree_less
-            "Predicate requirements".
-            \p pred must imply the same element order as the comparator used for building the tree.
-            \p pred should accept arguments of type \p Q, \p key_type, \p value_type in any combination.
+            The function is similar to <tt>contains( key )</tt> but \p pred is used for key comparing.
+            \p Less functor has the interface like \p std::less.
+            \p Less must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool find_with( Q const& key, Less pred ) const
+        bool contains( Q const& key, Less pred ) const
         {
             CDS_UNUSED( pred );
             typedef ellen_bintree::details::compare<
@@ -671,6 +685,14 @@ namespace cds { namespace intrusive {
             m_Stat.onFindFailed();
             return false;
         }
+        //@cond
+        // Deprecated, use contains()
+        template <typename Q, typename Less>
+        bool find_with( Q const& key, Less pred ) const
+        {
+            return contains( key, pred );
+        }
+        //@endcond
 
         /// Finds the key \p key
         /** @anchor cds_intrusive_EllenBinTree_find_func
index 6888626c30db5ca0f4b471dea63ddf69a8850c52..8ae26e0eeb8540763abbdab7404886ebbcc3fb6e 100644 (file)
@@ -51,7 +51,7 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">true</ExcludedFromBuild>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_delodd_ellentree.cpp">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">false</ExcludedFromBuild>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_delodd_michael.cpp">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">false</ExcludedFromBuild>\r
index b7ecd466fe981b35c808e5894298873ad42ca221..9adc9845eed39602e4bbd2312f5001abc4d20d97 100644 (file)
 
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
 #   define CDSUNIT_DECLARE_EllenBinTreeMap_RCU_signal \
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_shb)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_shb_stat)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_sht)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_sht_stat)
-
-#   define CDSUNIT_DEFINE_EllenBinTreeMap_RCU_signal( IMPL, C ) \
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_shb)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_shb_stat)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_sht)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_sht_stat)
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_shb)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_shb_stat)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_sht)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_sht_stat)
 
 #   define CDSUNIT_TEST_EllenBinTreeMap_RCU_signal \
     CPPUNIT_TEST(EllenBinTreeMap_rcu_shb)\
     CPPUNIT_TEST(EllenBinTreeMap_rcu_sht_stat)
 #else
 #   define CDSUNIT_DECLARE_EllenBinTreeMap_RCU_signal
-#   define CDSUNIT_DEFINE_EllenBinTreeMap_RCU_signal( IMPL, C )
 #   define CDSUNIT_TEST_EllenBinTreeMap_RCU_signal
 #endif
 
 #define CDSUNIT_DECLARE_EllenBinTreeMap \
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_hp)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_hp_yield)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_hp_stat)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_dhp)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_dhp_yield)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_dhp_stat)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpi)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpi_stat)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpb)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpb_yield)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpb_stat)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpt)\
-    CDSUNIT_DECLARE_TEST(EllenBinTreeMap_rcu_gpt_stat)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_hp)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_hp_yield)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_hp_stat)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_dhp)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_dhp_yield)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_dhp_stat)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpi)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpi_stat)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpb)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpb_yield)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpb_stat)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpt)\
+    TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpt_stat)\
     CDSUNIT_DECLARE_EllenBinTreeMap_RCU_signal
 
-#define CDSUNIT_DEFINE_EllenBinTreeMap( IMPL, C ) \
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_hp)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_hp_yield)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_hp_stat)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_dhp)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_dhp_yield)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_dhp_stat)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpi)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpi_stat)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpb)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpb_yield)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpb_stat)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpt)\
-    TEST_MAP_NOLF_EXTRACT(IMPL, C, EllenBinTreeMap_rcu_gpt_stat)\
-    CDSUNIT_DEFINE_EllenBinTreeMap_RCU_signal( IMPL, C )
-
 #define CDSUNIT_TEST_EllenBinTreeMap \
     CPPUNIT_TEST(EllenBinTreeMap_hp)\
     CPPUNIT_TEST(EllenBinTreeMap_hp_yield)\
index 443b54e1da06692a46bf0810f24cd3b06789a269..fe45c6786e6f1599fff7a0fb1deddfa25b37a67a 100644 (file)
@@ -692,6 +692,7 @@ namespace map2 {
         CDSUNIT_DECLARE_MichaelMap
         CDSUNIT_DECLARE_SplitList
         CDSUNIT_DECLARE_SkipListMap
+        CDSUNIT_DECLARE_EllenBinTreeMap
 
         // This test is not suitable for MultiLevelHashMap
         //CDSUNIT_DECLARE_MultiLevelHashMap
@@ -700,6 +701,7 @@ namespace map2 {
             CDSUNIT_TEST_MichaelMap
             CDSUNIT_TEST_SplitList
             CDSUNIT_TEST_SkipListMap
+            CDSUNIT_TEST_EllenBinTreeMap
 
             //CDSUNIT_TEST_MultiLevelHashMap // the test is not suitable
         CPPUNIT_TEST_SUITE_END();
@@ -707,7 +709,6 @@ namespace map2 {
         ////CDSUNIT_DECLARE_StripedMap
         ////CDSUNIT_DECLARE_RefinableMap
         //CDSUNIT_DECLARE_CuckooMap
-        //CDSUNIT_DECLARE_EllenBinTreeMap
         //CDSUNIT_DECLARE_BronsonAVLTreeMap
         //CDSUNIT_DECLARE_MultiLevelHashMap
         ////CDSUNIT_DECLARE_StdMap
index fdeab8253214b648661c0eab72acc471beb3118d..c6139e51962062c35f03712eeace98c2562840da 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_delodd.h"
 #include "map2/map_type_ellen_bintree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_EllenBinTreeMap( cc::ellen_bintree::implementation_tag, Map_DelOdd)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_DelOdd::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_DelOdd, run_EllenBinTreeMap )
-        CDSUNIT_TEST_EllenBinTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_EllenBinTreeMap
 } // namespace map2
index 6b382b169c37461d115cbe165c77192d4799cedf..bc29546e8a4c64cb8ecee02641a2d3197da3be34 100644 (file)
 
 namespace map2 {
 
+    template <class GC, typename Key, typename T, typename Traits = cc::ellen_bintree::traits >
+    class EllenBinTreeMap : public cc::EllenBinTreeMap< GC, Key, T, Traits >
+    {
+        typedef cc::EllenBinTreeMap< GC, Key, T, Traits > base_class;
+    public:
+        template <typename Config>
+        EllenBinTreeMap( Config const& /*cfg*/)
+            : base_class()
+        {}
+
+        // for testing
+        static CDS_CONSTEXPR bool const c_bExtractSupported = true;
+        static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+    };
+
+    struct tag_EllenBinTreeMap;
+
     template <typename Key, typename Value>
-    struct map_type< cc::ellen_bintree::implementation_tag, Key, Value >: public map_type_base< Key, Value >
+    struct map_type< tag_EllenBinTreeMap, Key, Value >: public map_type_base< Key, Value >
     {
         typedef map_type_base< Key, Value > base_class;
         typedef typename base_class::compare    compare;
@@ -70,38 +87,38 @@ namespace map2 {
         struct traits_EllenBinTreeMap_hp : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp >EllenBinTreeMap_hp;
+        typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp >EllenBinTreeMap_hp;
 
         struct traits_EllenBinTreeMap_dhp : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp >EllenBinTreeMap_dhp;
+        typedef EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp >EllenBinTreeMap_dhp;
 
         struct traits_EllenBinTreeMap_gpi : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_gpi >EllenBinTreeMap_rcu_gpi;
+        typedef EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_gpi >EllenBinTreeMap_rcu_gpi;
 
         struct traits_EllenBinTreeMap_gpb : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb >EllenBinTreeMap_rcu_gpb;
+        typedef EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb >EllenBinTreeMap_rcu_gpb;
 
         struct traits_EllenBinTreeMap_gpt : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_gpt >EllenBinTreeMap_rcu_gpt;
+        typedef EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_gpt >EllenBinTreeMap_rcu_gpt;
 
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
         struct traits_EllenBinTreeMap_shb : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_shb >EllenBinTreeMap_rcu_shb;
+        typedef EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_shb >EllenBinTreeMap_rcu_shb;
 
         struct traits_EllenBinTreeMap_sht : traits_EllenBinTreeMap {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_sht >EllenBinTreeMap_rcu_sht;
+        typedef EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_sht >EllenBinTreeMap_rcu_sht;
 #endif
 
         struct traits_EllenBinTreeMap_yield : public traits_EllenBinTreeMap
@@ -111,17 +128,17 @@ namespace map2 {
         struct traits_EllenBinTreeMap_hp_yield : traits_EllenBinTreeMap_yield {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp_yield >EllenBinTreeMap_hp_yield;
+        typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp_yield >EllenBinTreeMap_hp_yield;
 
         struct traits_EllenBinTreeMap_dhp_yield : traits_EllenBinTreeMap_yield {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp_yield >EllenBinTreeMap_dhp_yield;
+        typedef EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp_yield >EllenBinTreeMap_dhp_yield;
 
         struct traits_EllenBinTreeMap_gpb_yield : traits_EllenBinTreeMap_yield {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb_yield >EllenBinTreeMap_rcu_gpb_yield;
+        typedef EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb_yield >EllenBinTreeMap_rcu_gpb_yield;
 
 
         struct traits_EllenBinTreeMap_stat: public cc::ellen_bintree::make_set_traits<
@@ -139,54 +156,54 @@ namespace map2 {
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_hp > EllenBinTreeMap_hp_stat;
+        typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_hp > EllenBinTreeMap_hp_stat;
 
         struct traits_EllenBinTreeMap_stat_dhp : public traits_EllenBinTreeMap_stat
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_dhp > EllenBinTreeMap_dhp_stat;
+        typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_dhp > EllenBinTreeMap_dhp_stat;
 
         struct traits_EllenBinTreeMap_stat_gpi : public traits_EllenBinTreeMap_stat
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_stat_gpi > EllenBinTreeMap_rcu_gpi_stat;
+        typedef EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_stat_gpi > EllenBinTreeMap_rcu_gpi_stat;
 
         struct traits_EllenBinTreeMap_stat_gpb : public traits_EllenBinTreeMap_stat
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_stat_gpb > EllenBinTreeMap_rcu_gpb_stat;
+        typedef EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_stat_gpb > EllenBinTreeMap_rcu_gpb_stat;
 
         struct traits_EllenBinTreeMap_stat_gpt : public traits_EllenBinTreeMap_stat
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_stat_gpt > EllenBinTreeMap_rcu_gpt_stat;
+        typedef EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_stat_gpt > EllenBinTreeMap_rcu_gpt_stat;
 
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
         struct traits_EllenBinTreeMap_stat_shb : public traits_EllenBinTreeMap_stat
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_stat_shb > EllenBinTreeMap_rcu_shb_stat;
+        typedef EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_stat_shb > EllenBinTreeMap_rcu_shb_stat;
 
         struct traits_EllenBinTreeMap_stat_sht : public traits_EllenBinTreeMap_stat
         {
             typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
         };
-        typedef cc::EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_stat_sht > EllenBinTreeMap_rcu_sht_stat;
+        typedef EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_stat_sht > EllenBinTreeMap_rcu_sht_stat;
 #endif
     };
 
     template <typename GC, typename Key, typename T, typename Traits>
-    static inline void print_stat( cc::EllenBinTreeMap<GC, Key, T, Traits> const& s )
+    static inline void print_stat( EllenBinTreeMap<GC, Key, T, Traits> const& s )
     {
         CPPUNIT_MSG( s.statistics() );
     }
     template <typename GC, typename Key, typename T, typename Traits>
-    static inline void additional_cleanup( cc::EllenBinTreeMap<GC, Key, T, Traits>& /*s*/ )
+    static inline void additional_cleanup( EllenBinTreeMap<GC, Key, T, Traits>& /*s*/ )
     {
         ellen_bintree_pool::internal_node_counter::reset();
     }
@@ -216,14 +233,14 @@ namespace map2 {
         }
     }   // namespace ellen_bintree_check
     template <typename GC, typename Key, typename T, typename Traits>
-    static inline void additional_check( cc::EllenBinTreeMap<GC, Key, T, Traits>& s )
+    static inline void additional_check( EllenBinTreeMap<GC, Key, T, Traits>& s )
     {
         GC::force_dispose();
         ellen_bintree_check::check_stat( s.statistics() );
     }
 
     template <typename GC, typename Key, typename T, typename Traits>
-    static inline void check_before_cleanup( cc::EllenBinTreeMap<GC, Key, T, Traits>& m )
+    static inline void check_before_cleanup( EllenBinTreeMap<GC, Key, T, Traits>& m )
     {
         CPPUNIT_MSG( "  Check internal consistency (single-threaded)..." );
         CPPUNIT_CHECK_CURRENT( m.check_consistency() );
index 8f95050e52c99a30b0184e0730b3cc9886304336..2a4cd57cfa27e043aaf33b0cbdfae05c31a43f39 100644 (file)
@@ -26,7 +26,7 @@ namespace map2 {
 
         // for testing
         static CDS_CONSTEXPR bool const c_bExtractSupported = true;
-        static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+        static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
     };
 
     struct tag_SkipListMap;