MichaelMap refactoring
authorkhizmax <libcds.dev@gmail.com>
Sun, 26 Oct 2014 13:04:49 +0000 (16:04 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 26 Oct 2014 13:04:49 +0000 (16:04 +0300)
27 files changed:
cds/container/details/michael_map_base.h
cds/container/details/michael_set_base.h
cds/container/michael_map.h
cds/container/michael_map_nogc.h
cds/container/michael_map_rcu.h
projects/Win/vc12/hdr-test-map.vcxproj
projects/Win/vc12/hdr-test-map.vcxproj.filters
projects/source.test-hdr.mk
tests/test-hdr/map/hdr_map.h
tests/test-hdr/map/hdr_michael_map_dhp.cpp [new file with mode: 0644]
tests/test-hdr/map/hdr_michael_map_hp.cpp
tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp [new file with mode: 0644]
tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp
tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp
tests/test-hdr/map/hdr_michael_map_lazy_ptb.cpp [deleted file]
tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp
tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp
tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp
tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp
tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp
tests/test-hdr/map/hdr_michael_map_nogc.cpp
tests/test-hdr/map/hdr_michael_map_ptb.cpp [deleted file]
tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp
tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp
tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp
tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp
tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp

index 6f3a5d63a60e0cdde9dcdb2be69efa3ae70f2e19..424e557ddb2116dffda62cd8a92e4cf3a70a3529 100644 (file)
@@ -11,10 +11,12 @@ namespace cds { namespace container {
     /** @ingroup cds_nonintrusive_helper
     */
     namespace michael_map {
-        /// Type traits for MichaelHashMap class
-        typedef container::michael_set::type_traits  type_traits;
+        /// \p MichaelHashMap traits
+        typedef container::michael_set::traits  traits;
 
-        using container::michael_set::make_traits;
+        /// Metafunction converting option list to \p michael_map::traits
+        template <typename... Options>
+        using make_traits = cds::intrusive::michael_set::make_traits< Options... >;
 
         //@cond
         namespace details {
@@ -26,7 +28,7 @@ namespace cds { namespace container {
 
     //@cond
     // Forward declarations
-    template <class GC, class OrderedList, class Traits = michael_map::type_traits>
+    template <class GC, class OrderedList, class Traits = michael_map::traits>
     class MichaelHashMap;
     //@endcond
 
index 662dc9784c87c3cfaaa47dac5e4bab549d6ac845..bc7961941cf137d6fab8ad2404625b8793c84693 100644 (file)
@@ -15,7 +15,7 @@ namespace cds { namespace container {
         /// MichaelHashSet traits
         typedef cds::intrusive::michael_set::traits  traits;
 
-        /// Metafunction converting option list to \p MichaelHashSet traits
+        /// Metafunction converting option list to \p michael_set::traits
         template <typename... Options>
         using make_traits = cds::intrusive::michael_set::make_traits< Options... >;
 
index 17cb80c4cbab0d8026539e3e8aeb8691c2bc1a62..285baeb561fb880c0c6671db6ea8def127928dbf 100644 (file)
@@ -24,20 +24,14 @@ namespace cds { namespace container {
         - \p GC - Garbage collector used. You may use any \ref cds_garbage_collector "Garbage collector"
             from the \p libcds library.
             Note the \p GC must be the same as the GC used for \p OrderedList
-        - \p OrderedList - ordered key-value list implementation used as bucket for hash map, for example, MichaelKVList
-            or LazyKVList. The ordered list implementation specifies the \p Key and \p Value types stored in the hash-map,
+        - \p OrderedList - ordered key-value list implementation used as bucket for hash map, for example, \p MichaelKVList
+            or \p LazyKVList. The ordered list implementation specifies the \p Key and \p Value types stored in the hash-map,
             the reclamation schema \p GC used by hash-map, the comparison functor for the type \p Key and other features
             specific for the ordered list.
-        - \p Traits - type traits. See michael_map::type_traits for explanation.
+        - \p Traits - map traits, default is \p michael_map::traits.
+            Instead of defining \p Traits struct you may use option-based syntax with \p michael_map::make_traits metafunction.
 
-        Instead of defining \p Traits struct you may use option-based syntax with \p michael_map::make_traits metafunction
-        (this metafunction is a synonym for michael_set::make_traits).
-        For \p michael_map::make_traits the following option may be used:
-        - opt::hash - mandatory option, specifies hash functor.
-        - opt::item_counter - optional, specifies item counting policy. See michael_map::type_traits for explanation.
-        - opt::allocator - optional, bucket table allocator. Default is \ref CDS_DEFAULT_ALLOCATOR.
-
-        Many of the class function take a key argument of type \p K that in general is not \ref key_type.
+        Many of the class function take a key argument of type \p K that in general is not \p key_type.
         \p key_type and an argument of template type \p K must meet the following requirements:
         - \p key_type should be constructible from value of type \p K;
         - the hash functor should be able to calculate correct hash value from argument \p key of type \p K:
@@ -45,9 +39,9 @@ namespace cds { namespace container {
         - values of type \p key_type and \p K should be comparable
 
         There are the specializations:
-        - for \ref cds_urcu_desc "RCU" - declared in <tt>cd/container/michael_map_rcu.h</tt>,
+        - for \ref cds_urcu_desc "RCU" - declared in <tt>cds/container/michael_map_rcu.h</tt>,
             see \ref cds_nonintrusive_MichaelHashMap_rcu "MichaelHashMap<RCU>".
-        - for \ref cds::gc::nogc declared in <tt>cds/container/michael_map_nogc.h</tt>,
+        - for \p cds::gc::nogc declared in <tt>cds/container/michael_map_nogc.h</tt>,
             see \ref cds_nonintrusive_MichaelHashMap_nogc "MichaelHashMap<gc::nogc>".
 
         <b>Iterators</b>
@@ -58,13 +52,13 @@ namespace cds { namespace container {
         so, the element cannot be reclaimed while the iterator object is alive.
         However, passing an iterator object between threads is dangerous.
 
-        \warning Due to concurrent nature of Michael's set it is not guarantee that you can iterate
+        @warning Due to concurrent nature of Michael's set it is not guarantee that you can iterate
         all elements in the set: any concurrent deletion can exclude the element
         pointed by the iterator from the set, and your iteration can be terminated
         before end of the set. Therefore, such iteration is more suitable for debugging purpose only
 
         Remember, each iterator object requires an additional hazard pointer, that may be
-        a limited resource for \p GC like \p gc::HP (for gc::PTB the count of
+        a limited resource for \p GC like \p gc::HP (for \p gc::DHP the count of
         guards is unlimited).
 
         The iterator class supports the following minimalistic interface:
@@ -95,13 +89,13 @@ namespace cds { namespace container {
         <b>How to use</b>
 
         Suppose, you want to make \p int to \p int map for Hazard Pointer garbage collector. You should
-        choose suitable ordered list class that will be used as a bucket for the map; it may be MichaelKVList.
+        choose suitable ordered list class that will be used as a bucket for the map; it may be \p MichaelKVList.
         \code
         #include <cds/container/michael_kvlist_hp.h>    // MichaelKVList for gc::HP
-        #include <cds/container/michael_map.h>          // MIchaelHashMap
+        #include <cds/container/michael_map.h>          // MichaelHashMap
 
         // List traits based on std::less predicate
-        struct list_traits: public cds::container::michael_list::type_traits
+        struct list_traits: public cds::container::michael_list::traits
         {
             typedef std::less<int>      less;
         };
@@ -110,7 +104,7 @@ namespace cds { namespace container {
         typedef cds::container::MichaelKVList< cds::gc::HP, int, int, list_traits> int2int_list;
 
         // Map traits
-        struct map_traits: public cds::container::michael_map::type_traits
+        struct map_traits: public cds::container::michael_map::traits
         {
             struct hash {
                 size_t operator()( int i ) const
@@ -137,7 +131,7 @@ namespace cds { namespace container {
         You may use option-based declaration:
         \code
         #include <cds/container/michael_kvlist_hp.h>    // MichaelKVList for gc::HP
-        #include <cds/container/michael_map.h>          // MIchaelHashMap
+        #include <cds/container/michael_map.h>          // MichaelHashMap
 
         // Ordered list
         typedef cds::container::MichaelKVList< cds::gc::HP, int, int,
@@ -158,7 +152,7 @@ namespace cds { namespace container {
         class GC,
         class OrderedList,
 #ifdef CDS_DOXYGEN_INVOKED
-        class Traits = michael_map::type_traits
+        class Traits = michael_map::traits
 #else
         class Traits
 #endif
@@ -166,29 +160,28 @@ namespace cds { namespace container {
     class MichaelHashMap
     {
     public:
-        typedef OrderedList bucket_type     ;   ///< type of ordered list used as a bucket implementation
-        typedef Traits      options         ;   ///< Traits template parameters
+        typedef GC          gc;          ///< Garbage collector
+        typedef OrderedList bucket_type; ///< type of ordered list to be used as a bucket
+        typedef Traits      traits;      ///< Map traits
 
-        typedef typename bucket_type::key_type          key_type        ;   ///< key type
-        typedef typename bucket_type::mapped_type       mapped_type     ;   ///< value type
-        typedef typename bucket_type::value_type        value_type      ;   ///< key/value pair stored in the map
+        typedef typename bucket_type::key_type    key_type;    ///< key type
+        typedef typename bucket_type::mapped_type mapped_type; ///< value type
+        typedef typename bucket_type::value_type  value_type;  ///< key/value pair stored in the map
 
-        typedef GC                                      gc              ;   ///< Garbage collector
-        typedef typename bucket_type::key_comparator    key_comparator  ;   ///< key compare functor
+        typedef typename bucket_type::key_comparator key_comparator;  ///< key compare functor
 
         /// Hash functor for \ref key_type and all its derivatives that you use
-        typedef typename cds::opt::v::hash_selector< typename options::hash >::type   hash;
-        typedef typename options::item_counter          item_counter    ;   ///< Item counter type
+        typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash;
+        typedef typename traits::item_counter  item_counter;   ///< Item counter type
 
         /// Bucket table allocator
-        typedef cds::details::Allocator< bucket_type, typename options::allocator >  bucket_table_allocator;
-        typedef typename bucket_type::guarded_ptr      guarded_ptr; ///< Guarded pointer
+        typedef cds::details::Allocator< bucket_type, typename traits::allocator >  bucket_table_allocator;
+        typedef typename bucket_type::guarded_ptr  guarded_ptr; ///< Guarded pointer
 
     protected:
-        item_counter    m_ItemCounter   ;   ///< Item counter
-        hash            m_HashFunctor   ;   ///< Hash functor
-
-        bucket_type *   m_Buckets       ;   ///< bucket table
+        item_counter    m_ItemCounter; ///< Item counter
+        hash            m_HashFunctor; ///< Hash functor
+        bucket_type *   m_Buckets;     ///< bucket table
 
     private:
         //@cond
@@ -196,6 +189,7 @@ namespace cds { namespace container {
         //@endcond
 
     protected:
+        //@cond
         /// Calculates hash value of \p key
         template <typename Q>
         size_t hash_value( Q const& key ) const
@@ -209,6 +203,7 @@ namespace cds { namespace container {
         {
             return m_Buckets[ hash_value( key ) ];
         }
+        //@endcond
 
     protected:
         //@cond
@@ -364,7 +359,7 @@ namespace cds { namespace container {
 
     public:
         /// Initializes the map
-        /**
+        /** @anchor cds_nonintrusive_MichaelHashMap_hp_ctor
             The Michael's hash map is non-expandable container. You should point the average count of items \p nMaxItemCount
             when you create an object.
             \p nLoadFactor parameter defines average count of items per bucket and it should be small number between 1 and 10.
@@ -379,10 +374,11 @@ namespace cds { namespace container {
         ) : m_nHashBitmask( michael_map::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
         {
             // GC and OrderedList::gc must be the same
-            static_assert(( std::is_same<gc, typename bucket_type::gc>::value ), "GC and OrderedList::gc must be the same");
+            static_assert( std::is_same<gc, typename bucket_type::gc>::value, "GC and OrderedList::gc must be the same");
 
             // atomicity::empty_item_counter is not allowed as a item counter
-            static_assert(( !std::is_same<item_counter, atomicity::empty_item_counter>::value ), "atomicity::empty_item_counter is not allowed as a item counter");
+            static_assert( !std::is_same<item_counter, atomicity::empty_item_counter>::value, 
+                           "atomicity::empty_item_counter is not allowed as a item counter");
 
             m_Buckets = bucket_table_allocator().NewArray( bucket_count() );
         }
@@ -449,12 +445,9 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            User-defined functor \p func should guarantee that during changing item's value no any other changes
-            could be made on this map's item by concurrent threads.
-            The user-defined functor can be passed by reference using \p std::ref
-            and it is called only if inserting is successful.
+            The user-defined functor is called only if inserting is successful.
 
-            The key_type should be constructible from value of type \p K.
+            The \p key_type should be constructible from value of type \p K.
 
             The function allows to split creating of new item into two part:
             - create item from \p key;
@@ -463,6 +456,10 @@ namespace cds { namespace container {
 
             This can be useful if complete initialization of object of \p mapped_type is heavyweight and
             it is preferable that the initialization should be completed only if inserting is successful.
+
+            @warning For \ref cds_nonintrusive_MichaelKVList_gc "MichaelKVList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
+            \ref cds_nonintrusive_LazyKVList_gc "LazyKVList" provides exclusive access to inserted item and does not require any node-level
+            synchronization.
         */
         template <typename K, typename Func>
         bool insert_key( const K& key, Func func )
@@ -482,11 +479,7 @@ namespace cds { namespace container {
             is inserted into the map (note that in this case the \p key_type should be
             constructible from type \p K).
             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 may signature is:
             \code
                 struct my_functor {
                     void operator()( bool bNew, value_type& item );
@@ -497,15 +490,15 @@ namespace cds { namespace container {
             - \p bNew - \p true if the item has been inserted, \p false otherwise
             - \p item - item of the list
 
-            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.
-
-            You may pass \p func argument by reference using \p std::ref
+            The functor may change any fields of the \p item.second that is \p mapped_type.
 
             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.
+
+            @warning For \ref cds_nonintrusive_MichaelKVList_gc "MichaelKVList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
+            \ref cds_nonintrusive_LazyKVList_gc "LazyKVList" provides exclusive access to inserted item and does not require any node-level
+            synchronization.
         */
         template <typename K, typename Func>
         std::pair<bool, bool> ensure( K const& key, Func func )
@@ -516,7 +509,7 @@ namespace cds { namespace container {
             return bRet;
         }
 
-        /// For key \p key inserts data of type \p mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
+        /// For key \p key inserts data of type \p mapped_type created from \p args
         /**
             \p key_type should be constructible from type \p K
 
@@ -573,7 +566,6 @@ namespace cds { namespace container {
                 void operator()(value_type& item) { ... }
             };
             \endcode
-            The functor may be passed by reference using <tt>boost:ref</tt>
 
             Return \p true if key is found and deleted, \p false otherwise
         */
@@ -667,8 +659,6 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You may pass \p f argument by reference using \p std::ref.
-
             The functor may change \p item.second. 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 map's \p item. If such access is
@@ -767,15 +757,7 @@ namespace cds { namespace container {
             return bucket( key ).get_with( ptr, key, pred );
         }
 
-        /// Clears the map (non-atomic)
-        /**
-            The function erases all items from the map.
-
-            The function is not atomic. It cleans up each bucket and then resets the item counter to zero.
-            If there are a thread that performs insertion while \p clear is working the result is undefined in general case:
-            <tt> empty() </tt> may return \p true but the map may contain item(s).
-            Therefore, \p clear may be used only for debugging purposes.
-        */
+        /// Clears the map (not atomic)
         void clear()
         {
             for ( size_t i = 0; i < bucket_count(); ++i )
@@ -801,9 +783,9 @@ namespace cds { namespace container {
 
         /// Returns the size of hash table
         /**
-            Since MichaelHashMap cannot dynamically extend the hash table size,
+            Since \p %MichaelHashMap cannot dynamically extend the hash table size,
             the value returned is an constant depending on object initialization parameters;
-            see MichaelHashMap::MichaelHashMap for explanation.
+            see \p MichaelHashMap::MichaelHashMap for explanation.
         */
         size_t bucket_count() const
         {
index 44f50b5825c6ab0b9a457d7786f5ccdba813a9fa..be6013a1edfd951334954c1b30d1e99029612700 100644 (file)
@@ -9,56 +9,53 @@
 
 namespace cds { namespace container {
 
-    /// Michael's hash map (template specialization for gc::nogc)
+    /// Michael's hash map (template specialization for \p cds::gc::nogc)
     /** @ingroup cds_nonintrusive_map
         \anchor cds_nonintrusive_MichaelHashMap_nogc
 
-        This specialization is intended for so-called persistent usage when no item
+        This specialization is so-called append-only when no item
         reclamation may be performed. The class does not support deleting of map item.
 
         See \ref cds_nonintrusive_MichaelHashMap_hp "MichaelHashMap" for description of template parameters.
-
-        The interface of the specialization is a little different.
     */
     template <
         class OrderedList,
 #ifdef CDS_DOXYGEN_INVOKED
-        class Traits = michael_map::type_traits
+        class Traits = michael_map::traits
 #else
         class Traits
 #endif
     >
-    class MichaelHashMap<gc::nogc, OrderedList, Traits>
+    class MichaelHashMap<cds::gc::nogc, OrderedList, Traits>
     {
     public:
-        typedef OrderedList bucket_type     ;   ///< type of ordered list used as a bucket implementation
-        typedef Traits      options         ;   ///< Traits template parameters
+        typedef cds::gc::nogc gc;        ///< No garbage collector
+        typedef OrderedList bucket_type; ///< type of ordered list used as a bucket implementation
+        typedef Traits      traits;      ///< Map traits
 
-        typedef typename bucket_type::key_type          key_type        ;   ///< key type
-        typedef typename bucket_type::mapped_type       mapped_type     ;   ///< type of value stored in the list
-        typedef typename bucket_type::value_type        value_type      ;   ///< Pair used as the some functor's argument
+        typedef typename bucket_type::key_type    key_type;    ///< key type
+        typedef typename bucket_type::mapped_type mapped_type; ///< type of value to be stored in the map
+        typedef typename bucket_type::value_type  value_type;  ///< Pair used as the some functor's argument
 
-        typedef gc::nogc                                gc              ;   ///< No garbage collector
-        typedef typename bucket_type::key_comparator    key_comparator  ;   ///< key comparison functor
+        typedef typename bucket_type::key_comparator key_comparator;   ///< key comparing functor
 
         /// Hash functor for \ref key_type and all its derivatives that you use
-        typedef typename cds::opt::v::hash_selector< typename options::hash >::type   hash;
-        typedef typename options::item_counter          item_counter    ;   ///< Item counter type
+        typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash;
+        typedef typename traits::item_counter item_counter;   ///< Item counter type
 
         /// Bucket table allocator
-        typedef cds::details::Allocator< bucket_type, typename options::allocator >  bucket_table_allocator;
+        typedef cds::details::Allocator< bucket_type, typename traits::allocator >  bucket_table_allocator;
 
     protected:
         //@cond
-        typedef typename bucket_type::iterator          bucket_iterator;
-        typedef typename bucket_type::const_iterator    bucket_const_iterator;
+        typedef typename bucket_type::iterator       bucket_iterator;
+        typedef typename bucket_type::const_iterator bucket_const_iterator;
         //@endcond
 
     protected:
-        item_counter    m_ItemCounter   ;   ///< Item counter
-        hash            m_HashFunctor   ;   ///< Hash functor
-
-        bucket_type *   m_Buckets       ;   ///< bucket table
+        item_counter    m_ItemCounter; ///< Item counter
+        hash            m_HashFunctor; ///< Hash functor
+        bucket_type *   m_Buckets;     ///< bucket table
 
     private:
         //@cond
@@ -66,6 +63,7 @@ namespace cds { namespace container {
         //@endcond
 
     protected:
+        //@cond
         /// Calculates hash value of \p key
         size_t hash_value( key_type const & key ) const
         {
@@ -77,6 +75,7 @@ namespace cds { namespace container {
         {
             return m_Buckets[ hash_value( key ) ];
         }
+        //@endcond
 
     protected:
             protected:
@@ -235,7 +234,7 @@ namespace cds { namespace container {
         //@}
 
     private:
-        //@{
+        //@cond
         const_iterator get_const_begin() const
         {
             return const_iterator( const_cast<bucket_type const&>(m_Buckets[0]).begin(), m_Buckets, m_Buckets + bucket_count() );
@@ -244,18 +243,11 @@ namespace cds { namespace container {
         {
             return const_iterator( const_cast<bucket_type const&>(m_Buckets[bucket_count() - 1]).end(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count() );
         }
-        //@}
+        //@endcond
 
     public:
         /// Initialize the map
-        /**
-            The Michael's hash map is non-expandable container. You should point the average count of items \p nMaxItemCount
-            when you create an object.
-            \p nLoadFactor parameter defines average count of items per bucket and it should be small number between 1 and 10.
-            Remember, since the bucket implementation is an ordered list, searching in the bucket is linear [<tt>O(nLoadFactor)</tt>].
-            Note, that many popular STL hash map implementation uses load factor 1.
-
-            The ctor defines hash table size as rounding <tt>nMacItemCount / nLoadFactor</tt> up to nearest power of two.
+        /** @copydetails cds_nonintrusive_MichaelHashMap_hp_ctor
         */
         MichaelHashMap(
             size_t nMaxItemCount,   ///< estimation of max item count in the hash set
@@ -263,15 +255,16 @@ namespace cds { namespace container {
         ) : m_nHashBitmask( michael_map::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
         {
             // GC and OrderedList::gc must be the same
-            static_assert(( std::is_same<gc, typename bucket_type::gc>::value ), "GC and OrderedList::gc must be the same");
+            static_assert( std::is_same<gc, typename bucket_type::gc>::value, "GC and OrderedList::gc must be the same");
 
             // atomicity::empty_item_counter is not allowed as a item counter
-            static_assert(( !std::is_same<item_counter, atomicity::empty_item_counter>::value ),"atomicity::empty_item_counter is not allowed as a item counter");
+            static_assert( !std::is_same<item_counter, atomicity::empty_item_counter>::value,
+                           "cds::atomicity::empty_item_counter is not allowed as a item counter");
 
             m_Buckets = bucket_table_allocator().NewArray( bucket_count() );
         }
 
-        /// Clear hash set and destroy it
+        /// Clears hash set and destroys it
         ~MichaelHashMap()
         {
             clear();
@@ -340,12 +333,9 @@ namespace cds { namespace container {
 
             The argument \p item of user-defined functor \p func is the reference
             to the map's item inserted. <tt>item.second</tt> is a reference to item's value that may be changed.
-            User-defined functor \p func should guarantee that during changing item's value no any other changes
-            could be made on this map's item by concurrent threads.
-            The user-defined functor can be passed by reference using \p std::ref
-            and it is called only if the inserting is successful.
 
-            The key_type should be constructible from value of type \p K.
+            The user-defined functor it is called only if the inserting is successful.
+            The \p key_type should be constructible from value of type \p K.
 
             The function allows to split creating of new item into two part:
             - create item from \p key;
@@ -356,6 +346,10 @@ namespace cds { namespace container {
             it is preferable that the initialization should be completed only if inserting is successful.
 
             Returns an iterator pointed to inserted value, or \p end() if inserting is failed
+
+            @warning For \ref cds_nonintrusive_MichaelKVList_nogc "MichaelKVList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
+            \ref cds_nonintrusive_LazyKVList_nogc "LazyKVList" provides exclusive access to inserted item and does not require any node-level
+            synchronization.
         */
         template <typename K, typename Func>
         iterator insert_key( const K& key, Func func )
@@ -371,7 +365,7 @@ namespace cds { namespace container {
             return end();
         }
 
-        /// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
+        /// For key \p key inserts data of type \p mapped_type created from \p args
         /**
             \p key_type should be constructible from type \p K
 
@@ -399,6 +393,10 @@ namespace cds { namespace container {
             Returns <tt> std::pair<iterator, bool>  </tt> where \p first is an iterator pointing to
             item found or inserted, \p second is true if new item has been added or \p false if the item
             already is in the list.
+
+            @warning For \ref cds_nonintrusive_MichaelKVList_nogc "MichaelKVList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
+            \ref cds_nonintrusive_LazyKVList_nogc "LazyKVList" provides exclusive access to inserted item and does not require any node-level
+            synchronization.
         */
         template <typename K>
         std::pair<iterator, bool> ensure( const K& key )
@@ -450,13 +448,7 @@ namespace cds { namespace container {
             return end();
         }
 
-        /// Clears the map (non-atomic)
-        /**
-            The function deletes all items from the map.
-            The function is not atomic. It cleans up each bucket and then resets the item counter to zero.
-            If there are a thread that performs insertion while \p clear is working the result is undefined in general case:
-            <tt> empty() </tt> may return \p true but the map may contain item(s).
-        */
+        /// Clears the map (not atomic)
         void clear()
         {
             for ( size_t i = 0; i < bucket_count(); ++i )
@@ -464,8 +456,7 @@ namespace cds { namespace container {
             m_ItemCounter.reset();
         }
 
-
-        /// Checks if the map is empty
+        /// Checks whether the map is empty
         /**
             Emptiness is checked by item counting: if item count is zero then the map is empty.
             Thus, the correct item counting feature is an important part of Michael's map implementation.
@@ -483,15 +474,14 @@ namespace cds { namespace container {
 
         /// Returns the size of hash table
         /**
-            Since MichaelHashMap cannot dynamically extend the hash table size,
+            Since \p %MichaelHashMap cannot dynamically extend the hash table size,
             the value returned is an constant depending on object initialization parameters;
-            see MichaelHashMap::MichaelHashMap for explanation.
+            see \p MichaelHashMap::MichaelHashMap for explanation.
         */
         size_t bucket_count() const
         {
             return m_nHashBitmask + 1;
         }
-
     };
 }} // namespace cds::container
 
index 8e17eb08ed6566691f9dcd3710c5bf12d20dc621..5fd03535ad76ab80075046d9ff863afbf285ae4a 100644 (file)
@@ -22,20 +22,14 @@ namespace cds { namespace container {
 
         Template parameters are:
         - \p RCU - one of \ref cds_urcu_gc "RCU type"
-        - \p OrderedList - ordered key-value list implementation used as bucket for hash map, for example, MichaelKVList.
+        - \p OrderedList - ordered key-value list implementation used as bucket for hash map, for example, \p MichaelKVList.
             The ordered list implementation specifies the \p Key and \p Value types stored in the hash-map, the reclamation
             schema \p GC used by hash-map, the comparison functor for the type \p Key and other features specific for
             the ordered list.
-        - \p Traits - type traits. See michael_map::type_traits for explanation.
+        - \p Traits - map traits, default is \p michael_map::traits.
+            Instead of defining \p Traits struct you may use option-based syntax with \p michael_map::make_traits metafunction
 
-        Instead of defining \p Traits struct you may use option-based syntax with \p michael_map::make_traits metafunction
-        (this metafunction is a synonym for michael_set::make_traits).
-        For \p michael_map::make_traits the following option may be used:
-        - opt::hash - mandatory option, specifies hash functor.
-        - opt::item_counter - optional, specifies item counting policy. See michael_map::type_traits for explanation.
-        - opt::allocator - optional, bucket table allocator. Default is \ref CDS_DEFAULT_ALLOCATOR.
-
-        Many of the class function take a key argument of type \p K that in general is not \ref key_type.
+        Many of the class function take a key argument of type \p K that in general is not \p key_type.
         \p key_type and an argument of template type \p K must meet the following requirements:
         - \p key_type should be constructible from value of type \p K;
         - the hash functor should be able to calculate correct hash value from argument \p key of type \p K:
@@ -52,7 +46,7 @@ namespace cds { namespace container {
         class RCU,
         class OrderedList,
 #ifdef CDS_DOXYGEN_INVOKED
-        class Traits = michael_map::type_traits
+        class Traits = michael_map::traits
 #else
         class Traits
 #endif
@@ -60,33 +54,31 @@ namespace cds { namespace container {
     class MichaelHashMap< cds::urcu::gc< RCU >, OrderedList, Traits >
     {
     public:
-        typedef OrderedList bucket_type     ;   ///< type of ordered list used as a bucket implementation
-        typedef Traits      options         ;   ///< Traits template parameters
+        typedef cds::urcu::gc< RCU > gc;   ///< RCU used as garbage collector
+        typedef OrderedList bucket_type;   ///< type of ordered list used as a bucket implementation
+        typedef Traits      traits;        ///< Map traits
 
         typedef typename bucket_type::key_type          key_type        ;   ///< key type
         typedef typename bucket_type::mapped_type       mapped_type     ;   ///< value type
         typedef typename bucket_type::value_type        value_type      ;   ///< key/value pair stored in the list
-
-        typedef cds::urcu::gc< RCU >                    gc              ;   ///< RCU used as garbage collector
         typedef typename bucket_type::key_comparator    key_comparator  ;   ///< key comparison functor
 
         /// Hash functor for \ref key_type and all its derivatives that you use
-        typedef typename cds::opt::v::hash_selector< typename options::hash >::type   hash;
-        typedef typename options::item_counter          item_counter    ;   ///< Item counter type
+        typedef typename cds::opt::v::hash_selector< typename traits::hash >::type   hash;
+        typedef typename traits::item_counter  item_counter;   ///< Item counter type
 
         /// Bucket table allocator
-        typedef cds::details::Allocator< bucket_type, typename options::allocator >  bucket_table_allocator;
+        typedef cds::details::Allocator< bucket_type, typename traits::allocator >  bucket_table_allocator;
 
-        typedef typename bucket_type::rcu_lock      rcu_lock   ; ///< RCU scoped lock
-        typedef typename bucket_type::exempt_ptr    exempt_ptr ; ///< pointer to extracted node
+        typedef typename bucket_type::rcu_lock      rcu_lock;   ///< RCU scoped lock
+        typedef typename bucket_type::exempt_ptr    exempt_ptr; ///< pointer to extracted node
         /// Group of \p extract_xxx functions require external locking if underlying ordered list requires that
         static CDS_CONSTEXPR const bool c_bExtractLockExternal = bucket_type::c_bExtractLockExternal;
 
     protected:
-        item_counter    m_ItemCounter   ;   ///< Item counter
-        hash            m_HashFunctor   ;   ///< Hash functor
-
-        bucket_type *   m_Buckets       ;   ///< bucket table
+        item_counter    m_ItemCounter; ///< Item counter
+        hash            m_HashFunctor; ///< Hash functor
+        bucket_type *   m_Buckets;     ///< bucket table
 
     private:
         //@cond
@@ -94,6 +86,7 @@ namespace cds { namespace container {
         //@endcond
 
     protected:
+        //@cond
         /// Calculates hash value of \p key
         template <typename Q>
         size_t hash_value( Q const& key ) const
@@ -102,7 +95,6 @@ namespace cds { namespace container {
         }
 
         /// Returns the bucket (ordered list) for \p key
-        //@{
         template <typename Q>
         bucket_type&    bucket( Q const& key )
         {
@@ -113,7 +105,7 @@ namespace cds { namespace container {
         {
             return m_Buckets[ hash_value( key ) ];
         }
-        //@}
+        //@endcond
     protected:
         /// Forward iterator
         /**
@@ -288,14 +280,7 @@ namespace cds { namespace container {
 
     public:
         /// Initializes the map
-        /**
-            The Michael's hash map is non-expandable container. You should point the average count of items \p nMaxItemCount
-            when you create an object.
-            \p nLoadFactor parameter defines average count of items per bucket and it should be small number between 1 and 10.
-            Remember, since the bucket implementation is an ordered list, searching in the bucket is linear [<tt>O(nLoadFactor)</tt>].
-            Note, that many popular STL hash map implementation uses load factor 1.
-
-            The ctor defines hash table size as rounding <tt>nMacItemCount / nLoadFactor</tt> up to nearest power of two.
+        /** @copydetails cds_nonintrusive_MichaelHashMap_hp_ctor
         */
         MichaelHashMap(
             size_t nMaxItemCount,   ///< estimation of max item count in the hash map
@@ -303,10 +288,11 @@ namespace cds { namespace container {
         ) : m_nHashBitmask( michael_map::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
         {
             // GC and OrderedList::gc must be the same
-            static_assert(( std::is_same<gc, typename bucket_type::gc>::value ), "GC and OrderedList::gc must be the same");
+            static_assert( std::is_same<gc, typename bucket_type::gc>::value, "GC and OrderedList::gc must be the same");
 
             // atomicity::empty_item_counter is not allowed as a item counter
-            static_assert(( !std::is_same<item_counter, atomicity::empty_item_counter>::value ), "atomicity::empty_item_counter is not allowed as a item counter");
+            static_assert( !std::is_same<item_counter, cds::atomicity::empty_item_counter>::value, 
+                           "cds::atomicity::empty_item_counter is not allowed as a item counter");
 
             m_Buckets = bucket_table_allocator().NewArray( bucket_count() );
         }
@@ -323,9 +309,9 @@ namespace cds { namespace container {
             The function creates a node with \p key and default value, and then inserts the node created into the map.
 
             Preconditions:
-            - The \ref key_type should be constructible from value of type \p K.
+            - The \p key_type should be constructible from value of type \p K.
                 In trivial case, \p K is equal to \ref key_type.
-            - The \ref mapped_type should be default-constructible.
+            - The \p mapped_type should be default-constructible.
 
             The function applies RCU lock internally.
 
@@ -346,8 +332,8 @@ namespace cds { namespace container {
             and then inserts the node created into the map.
 
             Preconditions:
-            - The \ref key_type should be constructible from \p key of type \p K.
-            - The \ref mapped_type should be constructible from \p val of type \p V.
+            - The \p key_type should be constructible from \p key of type \p K.
+            - The \p mapped_type should be constructible from \p val of type \p V.
 
             The function applies RCU lock internally.
 
@@ -377,10 +363,7 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            User-defined functor \p func should guarantee that during changing item's value no any other changes
-            could be made on this map's item by concurrent threads.
-            The user-defined functor can be passed by reference using \p std::ref
-            and it is called only if inserting is successful.
+            The user-defined functor is called only if inserting is successful.
 
             The key_type should be constructible from value of type \p K.
 
@@ -393,6 +376,10 @@ namespace cds { namespace container {
             it is preferable that the initialization should be completed only if inserting is successful.
 
             The function applies RCU lock internally.
+
+            @warning For \ref cds_nonintrusive_MichaelKVList_rcu "MichaelKVList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
+            \ref cds_nonintrusive_LazyKVList_rcu "LazyKVList" provides exclusive access to inserted item and does not require any node-level
+            synchronization.
         */
         template <typename K, typename Func>
         bool insert_key( const K& key, Func func )
@@ -427,17 +414,17 @@ namespace cds { namespace container {
             - \p bNew - \p true if the item has been inserted, \p false otherwise
             - \p item - item of the list
 
-            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.
-
-            You may pass \p func argument by reference using \p std::ref
+            The functor may change any fields of the \p item.second that is \ref mapped_type.
 
             The function applies RCU lock internally.
 
             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.
+
+            @warning For \ref cds_nonintrusive_MichaelKVList_rcu "MichaelKVList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
+            \ref cds_nonintrusive_LazyKVList_rcu "LazyKVList" provides exclusive access to inserted item and does not require any node-level
+            synchronization.
         */
         template <typename K, typename Func>
         std::pair<bool, bool> ensure( K const& key, Func func )
@@ -448,7 +435,7 @@ namespace cds { namespace container {
             return bRet;
         }
 
-        /// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
+        /// For key \p key inserts data of type \p mapped_type created from \p args
         /**
             \p key_type should be constructible from type \p K
 
@@ -619,8 +606,6 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You may pass \p f argument by reference using \p std::ref.
-
             The functor may change \p item.second. 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 map's \p item. If such access is
@@ -724,7 +709,7 @@ namespace cds { namespace container {
             return bucket( key ).get_with( key, pred );
         }
 
-        /// Clears the map (non-atomic)
+        /// Clears the map (noatomic)
         /**
             The function erases all items from the map.
 
@@ -760,9 +745,9 @@ namespace cds { namespace container {
 
         /// Returns the size of hash table
         /**
-            Since MichaelHashMap cannot dynamically extend the hash table size,
+            Since \p %MichaelHashMap cannot dynamically extend the hash table size,
             the value returned is an constant depending on object initialization parameters;
-            see MichaelHashMap::MichaelHashMap for explanation.
+            see \p MichaelHashMap::MichaelHashMap for explanation.
         */
         size_t bucket_count() const
         {
index a7b44c84759581c84f41898dc4e8e28518b8cc12..5bc25c980e24c79ffd34a00241417c92872d78d2 100644 (file)
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_cuckoo_map.cpp" />\r
+    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_dhp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_hp.cpp" />\r
+    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_dhp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_hp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_nogc.cpp" />\r
-    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_ptb.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpb.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpi.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpt.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_shb.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_sht.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_nogc.cpp" />\r
-    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_ptb.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpb.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpi.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpt.cpp" />\r
index 43021b3d3d78ee9d3a1c0b534bd8c508ab5d8ade..fd3fa960af9cc8dbdf4b060334f15d0175b54917 100644 (file)
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_nogc.cpp">\r
       <Filter>michael</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_ptb.cpp">\r
-      <Filter>michael</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_nogc.cpp">\r
       <Filter>michael</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_ptb.cpp">\r
-      <Filter>michael</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_flat_map.cpp">\r
       <Filter>striped</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_sht.cpp">\r
       <Filter>split_list</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_dhp.cpp">\r
+      <Filter>michael</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_dhp.cpp">\r
+      <Filter>michael</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_map.h" />\r
index 66a6a7ab2d5a86342a6ccfe213f010f5d3c7fad5..740cffceac7144eef260c829bc2dacaec278286f 100644 (file)
@@ -1,6 +1,6 @@
 CDS_TESTHDR_MAP := \
     tests/test-hdr/map/hdr_michael_map_hp.cpp \
-    tests/test-hdr/map/hdr_michael_map_ptb.cpp \
+    tests/test-hdr/map/hdr_michael_map_dhp.cpp \
     tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp \
     tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp \
     tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp \
@@ -8,8 +8,7 @@ CDS_TESTHDR_MAP := \
     tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp \
     tests/test-hdr/map/hdr_michael_map_nogc.cpp \
     tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp \
-    tests/test-hdr/map/hdr_michael_map_lazy_hrc.cpp \
-    tests/test-hdr/map/hdr_michael_map_lazy_ptb.cpp \
+    tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp \
     tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp \
     tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp \
     tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp \
@@ -25,7 +24,6 @@ CDS_TESTHDR_MAP := \
     tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp \
     tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp \
     tests/test-hdr/map/hdr_skiplist_map_hp.cpp \
-    tests/test-hdr/map/hdr_skiplist_map_hrc.cpp \
     tests/test-hdr/map/hdr_skiplist_map_ptb.cpp \
     tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp \
     tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp \
@@ -42,7 +40,6 @@ CDS_TESTHDR_MAP := \
     tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp \
     tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp \
     tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp \
-    tests/test-hdr/map/hdr_splitlist_map_lazy_hrc.cpp \
     tests/test-hdr/map/hdr_splitlist_map_lazy_ptb.cpp \
     tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp \
     tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp \
@@ -139,7 +136,6 @@ CDS_TESTHDR_SET := \
     tests/test-hdr/set/hdr_intrusive_refinable_hashset_treapset.cpp \
     tests/test-hdr/set/hdr_intrusive_refinable_hashset_uset.cpp \
     tests/test-hdr/set/hdr_intrusive_skiplist_hp.cpp \
-    tests/test-hdr/set/hdr_intrusive_skiplist_hrc.cpp \
     tests/test-hdr/set/hdr_intrusive_skiplist_ptb.cpp \
     tests/test-hdr/set/hdr_intrusive_skiplist_rcu_gpb.cpp \
     tests/test-hdr/set/hdr_intrusive_skiplist_rcu_gpi.cpp \
@@ -147,7 +143,6 @@ CDS_TESTHDR_SET := \
     tests/test-hdr/set/hdr_intrusive_skiplist_rcu_shb.cpp \
     tests/test-hdr/set/hdr_intrusive_skiplist_rcu_sht.cpp \
     tests/test-hdr/set/hdr_intrusive_skiplist_nogc.cpp \
-    tests/test-hdr/set/hdr_intrusive_splitlist_set_hrc_lazy.cpp \
     tests/test-hdr/set/hdr_intrusive_striped_hashset_avlset.cpp \
     tests/test-hdr/set/hdr_intrusive_striped_hashset_list.cpp \
     tests/test-hdr/set/hdr_intrusive_striped_hashset_set.cpp \
index a0ac48d4f4857ce4dd891e912c7e8ef6b5ab146b..e48f60d37dbc88048868e0fc44bad07fcd30ec56 100644 (file)
@@ -632,9 +632,9 @@ namespace map {
         void Michael_HP_less();
         void Michael_HP_cmpmix();
 
-        void Michael_PTB_cmp();
-        void Michael_PTB_less();
-        void Michael_PTB_cmpmix();
+        void Michael_DHP_cmp();
+        void Michael_DHP_less();
+        void Michael_DHP_cmpmix();
 
         void Michael_RCU_GPI_cmp();
         void Michael_RCU_GPI_less();
@@ -664,9 +664,9 @@ namespace map {
         void Lazy_HP_less();
         void Lazy_HP_cmpmix();
 
-        void Lazy_PTB_cmp();
-        void Lazy_PTB_less();
-        void Lazy_PTB_cmpmix();
+        void Lazy_DHP_cmp();
+        void Lazy_DHP_less();
+        void Lazy_DHP_cmpmix();
 
         void Lazy_RCU_GPI_cmp();
         void Lazy_RCU_GPI_less();
@@ -761,9 +761,9 @@ namespace map {
             CPPUNIT_TEST(Michael_HP_less)
             CPPUNIT_TEST(Michael_HP_cmpmix)
 
-            CPPUNIT_TEST(Michael_PTB_cmp)
-            CPPUNIT_TEST(Michael_PTB_less)
-            CPPUNIT_TEST(Michael_PTB_cmpmix)
+            CPPUNIT_TEST(Michael_DHP_cmp)
+            CPPUNIT_TEST(Michael_DHP_less)
+            CPPUNIT_TEST(Michael_DHP_cmpmix)
 
             CPPUNIT_TEST(Michael_RCU_GPI_cmp)
             CPPUNIT_TEST(Michael_RCU_GPI_less)
@@ -793,9 +793,9 @@ namespace map {
             CPPUNIT_TEST(Lazy_HP_less)
             CPPUNIT_TEST(Lazy_HP_cmpmix)
 
-            CPPUNIT_TEST(Lazy_PTB_cmp)
-            CPPUNIT_TEST(Lazy_PTB_less)
-            CPPUNIT_TEST(Lazy_PTB_cmpmix)
+            CPPUNIT_TEST(Lazy_DHP_cmp)
+            CPPUNIT_TEST(Lazy_DHP_less)
+            CPPUNIT_TEST(Lazy_DHP_cmpmix)
 
             CPPUNIT_TEST(Lazy_RCU_GPI_cmp)
             CPPUNIT_TEST(Lazy_RCU_GPI_less)
diff --git a/tests/test-hdr/map/hdr_michael_map_dhp.cpp b/tests/test-hdr/map/hdr_michael_map_dhp.cpp
new file mode 100644 (file)
index 0000000..9a48ed3
--- /dev/null
@@ -0,0 +1,87 @@
+//$$CDS-header$$
+
+#include "map/hdr_map.h"
+#include <cds/container/michael_kvlist_dhp.h>
+#include <cds/container/michael_map.h>
+
+namespace map {
+    namespace {
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef HashMapHdrTest::hash_int            hash;
+            typedef HashMapHdrTest::simple_item_counter item_counter;
+        };
+        struct DHP_cmp_traits: public cc::michael_list::traits
+        {
+            typedef HashMapHdrTest::cmp   compare;
+        };
+
+        struct DHP_less_traits: public cc::michael_list::traits
+        {
+            typedef HashMapHdrTest::less  less;
+        };
+
+        struct DHP_cmpmix_traits: public cc::michael_list::traits
+        {
+            typedef HashMapHdrTest::cmp   compare;
+            typedef HashMapHdrTest::less  less;
+        };
+    }
+
+    void HashMapHdrTest::Michael_DHP_cmp()
+    {
+        typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmp_traits > list;
+
+        // traits-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
+        test_int< map >();
+
+        // option-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list,
+            cc::michael_map::make_traits<
+                cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+            >::type
+        > opt_map;
+        test_int< opt_map >();
+    }
+
+    void HashMapHdrTest::Michael_DHP_less()
+    {
+        typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_less_traits > list;
+
+        // traits-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
+        test_int< map >();
+
+        // option-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list,
+            cc::michael_map::make_traits<
+                cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+            >::type
+        > opt_map;
+        test_int< opt_map >();
+    }
+
+    void HashMapHdrTest::Michael_DHP_cmpmix()
+    {
+        typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmpmix_traits > list;
+
+        // traits-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
+        test_int< map >();
+
+        // option-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list,
+            cc::michael_map::make_traits<
+                cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+            >::type
+        > opt_map;
+        test_int< opt_map >();
+    }
+
+
+} // namespace map
+
index e8484935d7e573b90998c50350f9a0c9cd7f5ded..86bfd62ce34b87c0537bea21f91ad31efc5eb1e0 100644 (file)
@@ -6,23 +6,23 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
 
-        struct HP_cmp_traits: public cc::michael_list::type_traits
+        struct HP_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct HP_less_traits: public cc::michael_list::type_traits
+        struct HP_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct HP_cmpmix_traits: public cc::michael_list::type_traits
+        struct HP_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp
new file mode 100644 (file)
index 0000000..9ff9d46
--- /dev/null
@@ -0,0 +1,87 @@
+//$$CDS-header$$
+
+#include "map/hdr_map.h"
+#include <cds/container/lazy_kvlist_dhp.h>
+#include <cds/container/michael_map.h>
+
+namespace map {
+    namespace {
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef HashMapHdrTest::hash_int            hash;
+            typedef HashMapHdrTest::simple_item_counter item_counter;
+        };
+        struct DHP_cmp_traits: public cc::lazy_list::traits
+        {
+            typedef HashMapHdrTest::cmp   compare;
+        };
+
+        struct DHP_less_traits: public cc::lazy_list::traits
+        {
+            typedef HashMapHdrTest::less  less;
+        };
+
+        struct DHP_cmpmix_traits: public cc::lazy_list::traits
+        {
+            typedef HashMapHdrTest::cmp   compare;
+            typedef HashMapHdrTest::less  less;
+        };
+    }
+
+    void HashMapHdrTest::Lazy_DHP_cmp()
+    {
+        typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmp_traits > list;
+
+        // traits-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
+        test_int< map >();
+
+        // option-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list,
+            cc::michael_map::make_traits<
+                cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+            >::type
+        > opt_map;
+        test_int< opt_map >();
+    }
+
+    void HashMapHdrTest::Lazy_DHP_less()
+    {
+        typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_less_traits > list;
+
+        // traits-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
+        test_int< map >();
+
+        // option-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list,
+            cc::michael_map::make_traits<
+                cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+            >::type
+        > opt_map;
+        test_int< opt_map >();
+    }
+
+    void HashMapHdrTest::Lazy_DHP_cmpmix()
+    {
+        typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmpmix_traits > list;
+
+        // traits-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
+        test_int< map >();
+
+        // option-based version
+        typedef cc::MichaelHashMap< cds::gc::DHP, list,
+            cc::michael_map::make_traits<
+                cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+            >::type
+        > opt_map;
+        test_int< opt_map >();
+    }
+
+
+} // namespace map
+
index 82b2340c5ce1f7587586a6ad4653f1cba2db9396..5502150c8786a018ee520d483d6ef2f5789315a0 100644 (file)
@@ -6,22 +6,22 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
-        struct HP_cmp_traits: public cc::lazy_list::type_traits
+        struct HP_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct HP_less_traits: public cc::lazy_list::type_traits
+        struct HP_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct HP_cmpmix_traits: public cc::lazy_list::type_traits
+        struct HP_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index c5fd1489214281c19a5d692f3baa1b43a8d856b8..eba7232a4ddf92ce43dbfbe6db33a50f5400c65b 100644 (file)
@@ -6,22 +6,22 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
-        struct nogc_cmp_traits: public cc::lazy_list::type_traits
+        struct nogc_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct nogc_less_traits: public cc::lazy_list::type_traits
+        struct nogc_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct nogc_cmpmix_traits: public cc::lazy_list::type_traits
+        struct nogc_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_ptb.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_ptb.cpp
deleted file mode 100644 (file)
index ed55333..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//$$CDS-header$$
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_kvlist_dhp.h>
-#include <cds/container/michael_map.h>
-
-namespace map {
-    namespace {
-        struct map_traits: public cc::michael_map::type_traits
-        {
-            typedef HashMapHdrTest::hash_int            hash;
-            typedef HashMapHdrTest::simple_item_counter item_counter;
-        };
-        struct PTB_cmp_traits: public cc::lazy_list::type_traits
-        {
-            typedef HashMapHdrTest::cmp   compare;
-        };
-
-        struct PTB_less_traits: public cc::lazy_list::type_traits
-        {
-            typedef HashMapHdrTest::less  less;
-        };
-
-        struct PTB_cmpmix_traits: public cc::lazy_list::type_traits
-        {
-            typedef HashMapHdrTest::cmp   compare;
-            typedef HashMapHdrTest::less  less;
-        };
-    }
-
-    void HashMapHdrTest::Lazy_PTB_cmp()
-    {
-        typedef cc::LazyKVList< cds::gc::PTB, int, HashMapHdrTest::value_type, PTB_cmp_traits > list;
-
-        // traits-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list, map_traits > map;
-        test_int< map >();
-
-        // option-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list,
-            cc::michael_map::make_traits<
-                cc::opt::hash< hash_int >
-                ,cc::opt::item_counter< simple_item_counter >
-            >::type
-        > opt_map;
-        test_int< opt_map >();
-    }
-
-    void HashMapHdrTest::Lazy_PTB_less()
-    {
-        typedef cc::LazyKVList< cds::gc::PTB, int, HashMapHdrTest::value_type, PTB_less_traits > list;
-
-        // traits-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list, map_traits > map;
-        test_int< map >();
-
-        // option-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list,
-            cc::michael_map::make_traits<
-                cc::opt::hash< hash_int >
-                ,cc::opt::item_counter< simple_item_counter >
-            >::type
-        > opt_map;
-        test_int< opt_map >();
-    }
-
-    void HashMapHdrTest::Lazy_PTB_cmpmix()
-    {
-        typedef cc::LazyKVList< cds::gc::PTB, int, HashMapHdrTest::value_type, PTB_cmpmix_traits > list;
-
-        // traits-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list, map_traits > map;
-        test_int< map >();
-
-        // option-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list,
-            cc::michael_map::make_traits<
-                cc::opt::hash< hash_int >
-                ,cc::opt::item_counter< simple_item_counter >
-            >::type
-        > opt_map;
-        test_int< opt_map >();
-    }
-
-
-} // namespace map
-
index b08e6a1bf4c7206e8df9695080160d34e9f62f5d..d27c98053f0b51bd58e796660bf46edf51f653fd 100644 (file)
@@ -7,24 +7,24 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
 
-        struct RCU_GPB_cmp_traits: public cc::lazy_list::type_traits
+        struct RCU_GPB_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_GPB_less_traits: public cc::lazy_list::type_traits
+        struct RCU_GPB_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_GPB_cmpmix_traits: public cc::lazy_list::type_traits
+        struct RCU_GPB_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index ec551536aed71d7a25518c8469fbf27cc5b8b38e..88d72001bfa78bb94af007386f5d05bc293fe1fb 100644 (file)
@@ -7,24 +7,24 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
 
-        struct RCU_GPI_cmp_traits: public cc::lazy_list::type_traits
+        struct RCU_GPI_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_GPI_less_traits: public cc::lazy_list::type_traits
+        struct RCU_GPI_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_GPI_cmpmix_traits: public cc::lazy_list::type_traits
+        struct RCU_GPI_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 2ee91022488cf56be6bab67a6c59996d2e60f140..2e25fac835b86fa607d77bc09622c512dcc469b4 100644 (file)
@@ -7,24 +7,24 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
 
-        struct RCU_GPT_cmp_traits: public cc::lazy_list::type_traits
+        struct RCU_GPT_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_GPT_less_traits: public cc::lazy_list::type_traits
+        struct RCU_GPT_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_GPT_cmpmix_traits: public cc::lazy_list::type_traits
+        struct RCU_GPT_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 4bdbc415ad2db4cc651fd7082fc0ef2ad579a345..17807aaa8285c6d59329cdaecf992ec01b82a84b 100644 (file)
@@ -8,24 +8,24 @@
 namespace map {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
 
-        struct RCU_SHB_cmp_traits: public cc::lazy_list::type_traits
+        struct RCU_SHB_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_SHB_less_traits: public cc::lazy_list::type_traits
+        struct RCU_SHB_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_SHB_cmpmix_traits: public cc::lazy_list::type_traits
+        struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 5f5897ee3852acd7b7db19a0997e6649464ed51f..5b9c3b651944938681c0c22f6152902162dc16f2 100644 (file)
@@ -8,24 +8,24 @@
 namespace map {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
 
-        struct RCU_SHT_cmp_traits: public cc::lazy_list::type_traits
+        struct RCU_SHT_cmp_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_SHT_less_traits: public cc::lazy_list::type_traits
+        struct RCU_SHT_less_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_SHT_cmpmix_traits: public cc::lazy_list::type_traits
+        struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 397510350dc5a77fc7d858c9b95497a0263bc72d..28b60ce13dd569b1ae549026e96f53ab00ab7513 100644 (file)
@@ -6,22 +6,22 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
-        struct nogc_cmp_traits: public cc::michael_list::type_traits
+        struct nogc_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct nogc_less_traits: public cc::michael_list::type_traits
+        struct nogc_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct nogc_cmpmix_traits: public cc::michael_list::type_traits
+        struct nogc_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
diff --git a/tests/test-hdr/map/hdr_michael_map_ptb.cpp b/tests/test-hdr/map/hdr_michael_map_ptb.cpp
deleted file mode 100644 (file)
index 3c1b25a..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//$$CDS-header$$
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_kvlist_dhp.h>
-#include <cds/container/michael_map.h>
-
-namespace map {
-    namespace {
-        struct map_traits: public cc::michael_map::type_traits
-        {
-            typedef HashMapHdrTest::hash_int            hash;
-            typedef HashMapHdrTest::simple_item_counter item_counter;
-        };
-        struct PTB_cmp_traits: public cc::michael_list::type_traits
-        {
-            typedef HashMapHdrTest::cmp   compare;
-        };
-
-        struct PTB_less_traits: public cc::michael_list::type_traits
-        {
-            typedef HashMapHdrTest::less  less;
-        };
-
-        struct PTB_cmpmix_traits: public cc::michael_list::type_traits
-        {
-            typedef HashMapHdrTest::cmp   compare;
-            typedef HashMapHdrTest::less  less;
-        };
-    }
-
-    void HashMapHdrTest::Michael_PTB_cmp()
-    {
-        typedef cc::MichaelKVList< cds::gc::PTB, int, HashMapHdrTest::value_type, PTB_cmp_traits > list;
-
-        // traits-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list, map_traits > map;
-        test_int< map >();
-
-        // option-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list,
-            cc::michael_map::make_traits<
-                cc::opt::hash< hash_int >
-                ,cc::opt::item_counter< simple_item_counter >
-            >::type
-        > opt_map;
-        test_int< opt_map >();
-    }
-
-    void HashMapHdrTest::Michael_PTB_less()
-    {
-        typedef cc::MichaelKVList< cds::gc::PTB, int, HashMapHdrTest::value_type, PTB_less_traits > list;
-
-        // traits-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list, map_traits > map;
-        test_int< map >();
-
-        // option-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list,
-            cc::michael_map::make_traits<
-                cc::opt::hash< hash_int >
-                ,cc::opt::item_counter< simple_item_counter >
-            >::type
-        > opt_map;
-        test_int< opt_map >();
-    }
-
-    void HashMapHdrTest::Michael_PTB_cmpmix()
-    {
-        typedef cc::MichaelKVList< cds::gc::PTB, int, HashMapHdrTest::value_type, PTB_cmpmix_traits > list;
-
-        // traits-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list, map_traits > map;
-        test_int< map >();
-
-        // option-based version
-        typedef cc::MichaelHashMap< cds::gc::PTB, list,
-            cc::michael_map::make_traits<
-                cc::opt::hash< hash_int >
-                ,cc::opt::item_counter< simple_item_counter >
-            >::type
-        > opt_map;
-        test_int< opt_map >();
-    }
-
-
-} // namespace map
-
index 0bcfb32236699dcbea087308bd98146d4579795a..ce970d398f8919c803a432f3de6936fe67d16054 100644 (file)
@@ -7,24 +7,24 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
 
-        struct RCU_GPB_cmp_traits: public cc::michael_list::type_traits
+        struct RCU_GPB_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_GPB_less_traits: public cc::michael_list::type_traits
+        struct RCU_GPB_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_GPB_cmpmix_traits: public cc::michael_list::type_traits
+        struct RCU_GPB_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 6e93fd9df6b7bdafb95ba233ea202ccef1700765..907f1bf93ac715ec8d5b6e6d4287836aec8e5023 100644 (file)
@@ -7,24 +7,24 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
 
-        struct RCU_GPI_cmp_traits: public cc::michael_list::type_traits
+        struct RCU_GPI_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_GPI_less_traits: public cc::michael_list::type_traits
+        struct RCU_GPI_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_GPI_cmpmix_traits: public cc::michael_list::type_traits
+        struct RCU_GPI_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 4d08ea8aae4dddfee7c206bf8c5229a7aa5816ad..4fad97e0fecbbad8165bc682cd07318cdc10de7b 100644 (file)
@@ -7,24 +7,24 @@
 
 namespace map {
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
 
-        struct RCU_GPT_cmp_traits: public cc::michael_list::type_traits
+        struct RCU_GPT_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_GPT_less_traits: public cc::michael_list::type_traits
+        struct RCU_GPT_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_GPT_cmpmix_traits: public cc::michael_list::type_traits
+        struct RCU_GPT_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 3ab347d03bca03c13bfa7c7f07e18286bff3bfe7..dc23222da4dba1ec8bca2b4e7b3e1c75bbb4fb39 100644 (file)
@@ -8,24 +8,24 @@
 namespace map {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
 
-        struct RCU_SHB_cmp_traits: public cc::michael_list::type_traits
+        struct RCU_SHB_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_SHB_less_traits: public cc::michael_list::type_traits
+        struct RCU_SHB_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_SHB_cmpmix_traits: public cc::michael_list::type_traits
+        struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;
index 4e88edb90fde05d334073fffa3a2ff1d2ca89cb9..f57742a0d1d1da4531bebd35503b3ad55a2885bc 100644 (file)
@@ -8,24 +8,24 @@
 namespace map {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
     namespace {
-        struct map_traits: public cc::michael_map::type_traits
+        struct map_traits: public cc::michael_map::traits
         {
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
         };
         typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
 
-        struct RCU_SHT_cmp_traits: public cc::michael_list::type_traits
+        struct RCU_SHT_cmp_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
         };
 
-        struct RCU_SHT_less_traits: public cc::michael_list::type_traits
+        struct RCU_SHT_less_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::less  less;
         };
 
-        struct RCU_SHT_cmpmix_traits: public cc::michael_list::type_traits
+        struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits
         {
             typedef HashMapHdrTest::cmp   compare;
             typedef HashMapHdrTest::less  less;