intrusive::SkipListSet refactoring
authorkhizmax <libcds.dev@gmail.com>
Tue, 4 Nov 2014 13:52:26 +0000 (16:52 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 4 Nov 2014 13:52:26 +0000 (16:52 +0300)
12 files changed:
cds/intrusive/details/skip_list_base.h
cds/intrusive/impl/skip_list.h
cds/intrusive/skip_list_nogc.h
cds/intrusive/skip_list_rcu.h
projects/Win/vc12/hdr-test-set.vcxproj
projects/Win/vc12/hdr-test-set.vcxproj.filters
tests/test-hdr/set/hdr_intrusive_skiplist_dhp.cpp [new file with mode: 0644]
tests/test-hdr/set/hdr_intrusive_skiplist_dhp_member.cpp [new file with mode: 0644]
tests/test-hdr/set/hdr_intrusive_skiplist_hp.cpp
tests/test-hdr/set/hdr_intrusive_skiplist_ptb.cpp [deleted file]
tests/test-hdr/set/hdr_intrusive_skiplist_ptb_member.cpp [deleted file]
tests/test-hdr/set/hdr_intrusive_skiplist_set.h

index 257e2bbace3a64e12fa418652d95937508b757c8..6d60c3d4e72f5823554136571ce6e04ae8649fbb 100644 (file)
@@ -9,7 +9,6 @@
 #include <cds/os/timer.h>
 #include <cds/urcu/options.h>
 
-
 namespace cds { namespace intrusive {
     /// SkipListSet related definitions
     /** @ingroup cds_intrusive_helper
@@ -22,25 +21,26 @@ namespace cds { namespace intrusive {
         /// Skip list node
         /**
             Template parameters:
-            - GC - garbage collector
-            - Tag - a tag used to distinguish between different implementation. An incomplete type may be used as a tag.
+            - \p GC - garbage collector
+            - \p Tag - a \ref cds_intrusive_hook_tag "tag"
         */
         template <class GC, typename Tag = opt::none>
-        class node {
+        class node 
+        {
         public:
-            typedef GC      gc          ;   ///< Garbage collector
-            typedef Tag     tag         ;   ///< tag
+            typedef GC      gc;  ///< Garbage collector
+            typedef Tag     tag; ///< tag
 
-            typedef cds::details::marked_ptr<node, 1>                       marked_ptr          ;   ///< marked pointer
-            typedef typename gc::template atomic_marked_ptr< marked_ptr>    atomic_marked_ptr   ;   ///< atomic marked pointer specific for GC
+            typedef cds::details::marked_ptr<node, 1>                     marked_ptr;        ///< marked pointer
+            typedef typename gc::template atomic_marked_ptr< marked_ptr>  atomic_marked_ptr; ///< atomic marked pointer specific for GC
             //@cond
             typedef atomic_marked_ptr tower_item_type;
             //@endcond
 
         protected:
-            atomic_marked_ptr       m_pNext     ;   ///< Next item in bottom-list (list at level 0)
-            unsigned int            m_nHeight   ;   ///< Node height (size of m_arrNext array). For node at level 0 the height is 1.
-            atomic_marked_ptr *     m_arrNext   ;   ///< Array of next items for levels 1 .. m_nHeight - 1. For node at level 0 \p m_arrNext is \p nullptr
+            atomic_marked_ptr       m_pNext;   ///< Next item in bottom-list (list at level 0)
+            unsigned int            m_nHeight; ///< Node height (size of m_arrNext array). For node at level 0 the height is 1.
+            atomic_marked_ptr *     m_arrNext; ///< Array of next items for levels 1 .. m_nHeight - 1. For node at level 0 \p m_arrNext is \p nullptr
 
         public:
             /// Constructs a node of height 1 (a bottom-list node)
@@ -125,8 +125,7 @@ namespace cds { namespace intrusive {
             {
                 return m_pNext == atomic_marked_ptr()
                     && m_arrNext == nullptr
-                    && m_nHeight <= 1
-;
+                    && m_nHeight <= 1;
             }
             //@endcond
         };
@@ -154,8 +153,8 @@ namespace cds { namespace intrusive {
         /// Base hook
         /**
             \p Options are:
-            - opt::gc - garbage collector used.
-            - opt::tag - a tag
+            - \p opt::gc - garbage collector
+            - \p opt::tag - a \ref cds_intrusive_hook_tag "tag"
         */
         template < typename... Options >
         struct base_hook: public hook< opt::base_hook_tag, Options... >
@@ -167,8 +166,8 @@ namespace cds { namespace intrusive {
             Use \p offsetof macro to define \p MemberOffset
 
             \p Options are:
-            - opt::gc - garbage collector used.
-            - opt::tag - a tag
+            - \p opt::gc - garbage collector
+            - \p opt::tag - a \ref cds_intrusive_hook_tag "tag"
         */
         template < size_t MemberOffset, typename... Options >
         struct member_hook: public hook< opt::member_hook_tag, Options... >
@@ -184,8 +183,8 @@ namespace cds { namespace intrusive {
             See \ref node_traits for \p NodeTraits interface description
 
             \p Options are:
-            - opt::gc - garbage collector used.
-            - opt::tag - a tag
+            - \p opt::gc - garbage collector
+            - \p opt::tag - a \ref cds_intrusive_hook_tag "tag"
         */
         template <typename NodeTraits, typename... Options >
         struct traits_hook: public hook< opt::traits_hook_tag, Options... >
@@ -222,8 +221,8 @@ namespace cds { namespace intrusive {
             Stateful generators are supported.
 
             Available \p Type implementations:
-            - \ref xorshift
-            - \ref turbo_pascal
+            - \p skip_list::xorshift
+            - \p skip_list::turbo_pascal
         */
         template <typename Type>
         struct random_level_generator {
@@ -338,7 +337,7 @@ namespace cds { namespace intrusive {
             }
         };
 
-        /// SkipListSet internal statistics
+        /// \p SkipListSet internal statistics
         template <typename EventCounter = cds::atomicity::event_counter>
         struct stat {
             typedef EventCounter event_counter ; ///< Event counter type
@@ -424,7 +423,7 @@ namespace cds { namespace intrusive {
             //@endcond
         };
 
-        /// SkipListSet empty internal statistics
+        /// \p SkipListSet empty internal statistics
         struct empty_stat {
             //@cond
             void onAddNode( unsigned int nHeight ) const {}
@@ -476,12 +475,12 @@ namespace cds { namespace intrusive {
         };
         //@endcond
 
-        /// Type traits for SkipListSet class
-        struct type_traits
+        /// \p SkipListSet traits
+        struct traits
         {
             /// Hook used
             /**
-                Possible values are: skip_list::base_hook, skip_list::member_hook, skip_list::traits_hook.
+                Possible values are: \p skip_list::base_hook, \p skip_list::member_hook, \p skip_list::traits_hook.
             */
             typedef base_hook<>       hook;
 
@@ -499,20 +498,21 @@ namespace cds { namespace intrusive {
 
             /// Disposer
             /**
-                The functor used for dispose removed items. Default is opt::v::empty_disposer.
+                The functor used for dispose removed items. Default is \p opt::v::empty_disposer.
             */
             typedef opt::v::empty_disposer          disposer;
 
             /// Item counter
             /**
                 The type for item counting feature.
-                Default is no item counter (\ref atomicity::empty_item_counter)
+                By default, item counting is disabled (\p atomicity::empty_item_counter)
+                \p atomicity::item_counter enables it.
             */
             typedef atomicity::empty_item_counter     item_counter;
 
             /// C++ memory ordering model
             /**
-                List of available memory ordering see opt::memory_model
+                List of available memory ordering see \p opt::memory_model
             */
             typedef opt::v::relaxed_ordering        memory_model;
 
@@ -523,7 +523,7 @@ namespace cds { namespace intrusive {
                 where half of the nodes that have level \p i pointers also have level <tt>i+1</tt> pointers
                 (i = 0..30). So, the height of a node is in range [0..31].
 
-                See skip_list::random_level_generator option setter.
+                See \p skip_list::random_level_generator option setter.
             */
             typedef turbo_pascal                    random_level_generator;
 
@@ -537,18 +537,22 @@ namespace cds { namespace intrusive {
             */
             typedef CDS_DEFAULT_ALLOCATOR           allocator;
 
-            /// back-off strategy used
+            /// back-off strategy
             /**
-                If the option is not specified, the cds::backoff::Default is used.
+                If the option is not specified, the \p cds::backoff::Default is used.
             */
             typedef cds::backoff::Default           back_off;
 
             /// Internal statistics
+            /**
+                By default, internal statistics is disabled (\p skip_list::empty_stat).
+                Use \p skip_list::stat to enable it.
+            */
             typedef empty_stat                      stat;
 
             /// RCU deadlock checking policy (only for \ref cds_intrusive_SkipListSet_rcu "RCU-based SkipListSet")
             /**
-                List of available options see opt::rcu_check_deadlock
+                List of available options see \p opt::rcu_check_deadlock
             */
             typedef opt::v::rcu_throw_deadlock      rcu_check_deadlock;
 
@@ -558,10 +562,30 @@ namespace cds { namespace intrusive {
             //@endcond
         };
 
-        /// Metafunction converting option list to SkipListSet traits
+        /// Metafunction converting option list to \p SkipListSet traits
         /**
-            This is a wrapper for <tt> cds::opt::make_options< type_traits, Options...> </tt>
-            \p Options list see \ref SkipListSet.
+            \p Options are:
+            - \p opt::hook - hook used. Possible values are: \p skip_list::base_hook, \p skip_list::member_hook, \p skip_list::traits_hook.
+                If the option is not specified, <tt>skip_list::base_hook<></tt> and \p gc::HP is used.
+            - \p opt::compare - key comparison functor. No default functor is provided.
+                If the option is not specified, the \p opt::less is used.
+            - \p opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
+            - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. Due the nature
+                of GC schema the disposer may be called asynchronously.
+            - \p opt::item_counter - the type of item counting feature. Default is disabled, i.e. \p atomicity::empty_item_counter.
+                To enable it use \p atomicity::item_counter
+            - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
+                or \p opt::v::sequential_consistent (sequentially consisnent memory model).
+            - \p skip_list::random_level_generator - random level generator. Can be \p skip_list::xorshift, 
+                \p skip_list::turbo_pascal (the default) or
+                user-provided one. See \p skip_list::random_level_generator option description for explanation.
+            - \p opt::allocator - although the skip-list is an intrusive container,
+                an allocator should be provided to maintain variable randomly-calculated height of the node
+                since the node can contain up to 32 next pointers. The allocator option is used to allocate an array of next pointers
+                for nodes which height is more than 1. Default is \ref CDS_DEFAULT_ALLOCATOR.
+            - \p opt::back_off - back-off strategy, default is \รง cds::backoff::Default.
+            - \p opt::stat - internal statistics. By default, it is disabled (\p skip_list::empty_stat).
+                To enable it use \p skip_list::stat
         */
         template <typename... Options>
         struct make_traits {
@@ -569,7 +593,7 @@ namespace cds { namespace intrusive {
             typedef implementation_defined type ;   ///< Metafunction result
 #   else
             typedef typename cds::opt::make_options<
-                typename cds::opt::find_type_traits< type_traits, Options... >::type
+                typename cds::opt::find_type_traits< traits, Options... >::type
                 ,Options...
             >::type   type;
 #   endif
@@ -581,7 +605,6 @@ namespace cds { namespace intrusive {
             class head_node: public Node
             {
                 typedef Node node_type;
-
                 typename node_type::atomic_marked_ptr   m_Tower[skip_list::c_nHeightLimit];
 
             public:
@@ -646,7 +669,7 @@ namespace cds { namespace intrusive {
     }   // namespace skip_list
 
     // Forward declaration
-    template <class GC, typename T, typename Traits = skip_list::type_traits >
+    template <class GC, typename T, typename Traits = skip_list::traits >
     class SkipListSet;
 
 }}   // namespace cds::intrusive
index b4b3406717a2477448bd1b1a07d9f213d8fcc0d8..62e4be0d888e16fb1952c165a907a35bb23c4b5e 100644 (file)
@@ -24,9 +24,9 @@ namespace cds { namespace intrusive {
             typedef BackOff                             back_off;
             typedef typename node_traits::node_type     node_type;
             typedef typename node_traits::value_type    value_type;
-            static bool const c_isConst = IsConst;
+            static CDS_CONSTEXPR bool const c_isConst = IsConst;
 
-            typedef typename std::conditional< c_isConst, value_type const &, value_type &>::type   value_ref;
+            typedef typename std::conditional< c_isConst, value_type const&, value_type&>::type   value_ref;
 
         protected:
             typedef typename node_type::marked_ptr          marked_ptr;
@@ -132,7 +132,7 @@ namespace cds { namespace intrusive {
                 return *this;
             }
 
-            iterator& operator = (const iterator& src)
+            iterator& operator =(const iterator& src)
             {
                 m_pNode = src.m_pNode;
                 m_guard.copy( src.m_guard );
@@ -176,48 +176,24 @@ namespace cds { namespace intrusive {
         The lock-free variant of skip-list is implemented according to book
             - [2008] M.Herlihy, N.Shavit "The Art of Multiprocessor Programming",
                 chapter 14.4 "A Lock-Free Concurrent Skiplist".
-        \note The algorithm described in this book cannot be directly adapted for C++ (roughly speaking,
-        the algo contains a lot of bugs). The \b libcds implementation applies the approach discovered
-        by M.Michael in his \ref cds_intrusive_MichaelList_hp "lock-free linked list".
 
         <b>Template arguments</b>:
-            - \p GC - Garbage collector used. Note the \p GC must be the same as the GC used for item type \p T (see skip_list::node).
-            - \p T - type to be stored in the list. The type must be based on skip_list::node (for skip_list::base_hook)
-                or it must have a member of type skip_list::node (for skip_list::member_hook).
-            - \p Traits - type traits. See skip_list::type_traits for explanation.
-
-        It is possible to declare option-based list with cds::intrusive::skip_list::make_traits metafunction istead of \p Traits template
-        argument.
-        Template argument list \p Options of cds::intrusive::skip_list::make_traits metafunction are:
-        - opt::hook - hook used. Possible values are: skip_list::base_hook, skip_list::member_hook, skip_list::traits_hook.
-            If the option is not specified, <tt>skip_list::base_hook<></tt> and gc::HP is used.
-        - opt::compare - key comparison functor. No default functor is provided.
-            If the option is not specified, the opt::less is used.
-        - opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
-        - opt::disposer - the functor used for dispose removed items. Default is opt::v::empty_disposer. Due the nature
-            of GC schema the disposer may be called asynchronously.
-        - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that is no item counting.
-        - opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default)
-            or opt::v::sequential_consistent (sequentially consisnent memory model).
-        - skip_list::random_level_generator - random level generator. Can be skip_list::xorshift, skip_list::turbo_pascal or
-            user-provided one. See skip_list::random_level_generator option description for explanation.
-            Default is \p %skip_list::turbo_pascal.
-        - opt::allocator - although the skip-list is an intrusive container,
-            an allocator should be provided to maintain variable randomly-calculated height of the node
-            since the node can contain up to 32 next pointers. The allocator option is used to allocate an array of next pointers
-            for nodes which height is more than 1. Default is \ref CDS_DEFAULT_ALLOCATOR.
-        - opt::back_off - back-off strategy used. If the option is not specified, the cds::backoff::Default is used.
-        - opt::stat - internal statistics. Available types: skip_list::stat, skip_list::empty_stat (the default)
-
-        \warning The skip-list requires up to 67 hazard pointers that may be critical for some GCs for which
+            - \p GC - Garbage collector used. Note the \p GC must be the same as the GC used for item type \p T, see \p skip_list::node.
+            - \p T - type to be stored in the list. The type must be based on \p skip_list::node (for \p skip_list::base_hook)
+                or it must have a member of type \p skip_list::node (for \p skip_list::member_hook).
+            - \p Traits - skip-list traits, default is \p skip_list::traits.
+                It is possible to declare option-based list with \p cds::intrusive::skip_list::make_traits metafunction istead of \p Traits 
+                template argument.
+
+        @warning The skip-list requires up to 67 hazard pointers that may be critical for some GCs for which
             the guard count is limited (like as \p gc::HP). Those GCs should be explicitly initialized with
             hazard pointer enough: \code cds::gc::HP myhp( 67 ) \endcode. Otherwise an run-time exception may be raised
             when you try to create skip-list object.
 
-        \note There are several specializations of \p %SkipListSet for each \p GC. You should include:
+        There are several specializations of \p %SkipListSet for each \p GC. You should include:
         - <tt><cds/intrusive/skip_list_hp.h></tt> for \p gc::HP garbage collector
         - <tt><cds/intrusive/skip_list_dhp.h></tt> for \p gc::DHP garbage collector
-        - <tt><cds/intrusive/skip_list_nogc.h></tt> for \ref cds_intrusive_SkipListSet_nogc for persistent set
+        - <tt><cds/intrusive/skip_list_nogc.h></tt> for \ref cds_intrusive_SkipListSet_nogc for append-only set
         - <tt><cds/intrusive/skip_list_rcu.h></tt> for \ref cds_intrusive_SkipListSet_rcu "RCU type"
 
         <b>Iterators</b>
@@ -228,13 +204,13 @@ namespace cds { namespace intrusive {
         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 skip-list set it is not guarantee that you can iterate
+        @warning Due to concurrent nature of skip-list 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 2 additional hazard pointers, that may be
-        a limited resource for \p GC like as \p gc::HP (for \p gc::PTB the count of
+        a limited resource for \p GC like as \p gc::HP (for \p gc::DHP the count of
         guards is unlimited).
 
         The iterator class supports the following minimalistic interface:
@@ -259,15 +235,15 @@ namespace cds { namespace intrusive {
             bool operator !=(iterator const& i ) const;
         };
         \endcode
-        Note, the iterator object returned by \ref end, \p cend member functions points to \p nullptr and should not be dereferenced.
+        Note, the iterator object returned by \p end(), \p cend() member functions points to \p nullptr and should not be dereferenced.
 
         <b>How to use</b>
 
-        You should incorporate skip_list::node into your struct \p T and provide
-        appropriate skip_list::type_traits::hook in your \p Traits template parameters. Usually, for \p Traits you
-        define a struct based on skip_list::type_traits.
+        You should incorporate \p skip_list::node into your struct \p T and provide
+        appropriate \p skip_list::traits::hook in your \p Traits template parameters. Usually, for \p Traits you
+        define a struct based on \p skip_list::traits.
 
-        Example for gc::HP and base hook:
+        Example for \p gc::HP and base hook:
         \code
         // Include GC-related skip-list specialization
         #include <cds/intrusive/skip_list_hp.h>
@@ -301,8 +277,8 @@ namespace cds { namespace intrusive {
         };
 
 
-        // Declare type_traits
-        struct my_traits: public cds::intrusive::skip_list::type_traits
+        // Declare your traits
+        struct my_traits: public cds::intrusive::skip_list::traits
         {
             typedef cds::intrusive::skip_list::base_hook< cds::opt::gc< cds::gc::HP > >   hook;
             typedef my_data_cmp compare;
@@ -339,7 +315,7 @@ namespace cds { namespace intrusive {
         class GC
        ,typename T
 #ifdef CDS_DOXYGEN_INVOKED
-       ,typename Traits = skip_list::type_traits
+       ,typename Traits = skip_list::traits
 #else
        ,typename Traits
 #endif
@@ -347,28 +323,28 @@ namespace cds { namespace intrusive {
     class SkipListSet
     {
     public:
-        typedef T       value_type      ;   ///< type of value stored in the skip-list
-        typedef Traits  options         ;   ///< Traits template parameter
+        typedef GC      gc;         ///< Garbage collector
+        typedef T       value_type; ///< type of value stored in the skip-list
+        typedef Traits  traits;     ///< Traits template parameter
 
-        typedef typename options::hook      hook        ;   ///< hook type
-        typedef typename hook::node_type    node_type   ;   ///< node type
+        typedef typename traits::hook    hook;      ///< hook type
+        typedef typename hook::node_type node_type; ///< node type
 
 #   ifdef CDS_DOXYGEN_INVOKED
         typedef implementation_defined key_comparator  ;    ///< key comparison functor based on opt::compare and opt::less option setter.
 #   else
-        typedef typename opt::details::make_comparator< value_type, options >::type key_comparator;
+        typedef typename opt::details::make_comparator< value_type, traits >::type key_comparator;
 #   endif
 
-        typedef typename options::disposer  disposer    ;   ///< disposer used
-        typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ;    ///< node traits
+        typedef typename traits::disposer  disposer;   ///< item disposer
+        typedef typename get_node_traits< value_type, node_type, hook>::type node_traits; ///< node traits
 
-        typedef GC  gc          ;   ///< Garbage collector
-        typedef typename options::item_counter  item_counter ;   ///< Item counting policy used
-        typedef typename options::memory_model  memory_model ;   ///< Memory ordering. See cds::opt::memory_model option
-        typedef typename options::random_level_generator    random_level_generator  ;   ///< random level generator
-        typedef typename options::allocator     allocator_type  ;   ///< allocator for maintaining array of next pointers of the node
-        typedef typename options::back_off      back_off    ;   ///< Back-off strategy
-        typedef typename options::stat          stat        ;   ///< internal statistics type
+        typedef typename traits::item_counter  item_counter;   ///< Item counting policy
+        typedef typename traits::memory_model  memory_model;   ///< Memory ordering, see \p cds::opt::memory_model option
+        typedef typename traits::random_level_generator random_level_generator; ///< random level generator
+        typedef typename traits::allocator     allocator_type;   ///< allocator for maintaining array of next pointers of the node
+        typedef typename traits::back_off      back_off;   ///< Back-off strategy
+        typedef typename traits::stat          stat;       ///< internal statistics type
 
     public:
         typedef cds::gc::guarded_ptr< gc, value_type > guarded_ptr; ///< Guarded pointer
@@ -376,7 +352,7 @@ namespace cds { namespace intrusive {
         /// Max node height. The actual node height should be in range <tt>[0 .. c_nMaxHeight)</tt>
         /**
             The max height is specified by \ref skip_list::random_level_generator "random level generator" constant \p m_nUpperBound
-            but it should be no more than 32 (\ref skip_list::c_nHeightLimit).
+            but it should be no more than 32 (\p skip_list::c_nHeightLimit).
         */
         static unsigned int const c_nMaxHeight = std::conditional<
             (random_level_generator::c_nUpperBound <= skip_list::c_nHeightLimit),
@@ -389,20 +365,20 @@ namespace cds { namespace intrusive {
         //@endcond
 
     protected:
-        typedef typename node_type::atomic_marked_ptr   atomic_node_ptr ;   ///< Atomic marked node pointer
-        typedef typename node_type::marked_ptr          marked_node_ptr ;   ///< Node marked pointer
+        typedef typename node_type::atomic_marked_ptr   atomic_node_ptr;   ///< Atomic marked node pointer
+        typedef typename node_type::marked_ptr          marked_node_ptr;   ///< Node marked pointer
 
     protected:
         //@cond
         typedef skip_list::details::intrusive_node_builder< node_type, atomic_node_ptr, allocator_type > intrusive_node_builder;
 
         typedef typename std::conditional<
-            std::is_same< typename options::internal_node_builder, cds::opt::none >::value
+            std::is_same< typename traits::internal_node_builder, cds::opt::none >::value
             ,intrusive_node_builder
-            ,typename options::internal_node_builder
+            ,typename traits::internal_node_builder
         >::type node_builder;
 
-        typedef std::unique_ptr< node_type, typename node_builder::node_disposer >    scoped_node_ptr;
+        typedef std::unique_ptr< node_type, typename node_builder::node_disposer > scoped_node_ptr;
 
         // c_nMaxHeight * 2 - pPred/pSucc guards
         // + 1 - for erase, unlink
@@ -412,19 +388,18 @@ namespace cds { namespace intrusive {
             node_type *   pPrev[ c_nMaxHeight ];
             node_type *   pSucc[ c_nMaxHeight ];
 
-            typename gc::template GuardArray< c_nMaxHeight * 2 > guards  ;   ///< Guards array for pPrev/pSucc
-
-            node_type *   pCur  ;   // guarded by guards; needed only for *ensure* function
+            typename gc::template GuardArray< c_nMaxHeight * 2 > guards;   ///< Guards array for pPrev/pSucc
+            node_type *   pCur;   // guarded by guards; needed only for \p ensure()
         };
         //@endcond
 
     protected:
-        skip_list::details::head_node< node_type >      m_Head  ;   ///< head tower (max height)
+        skip_list::details::head_node< node_type > m_Head;   ///< head tower (max height)
 
-        item_counter                m_ItemCounter       ;   ///< item counter
-        random_level_generator      m_RandomLevelGen    ;   ///< random level generator instance
-        atomics::atomic<unsigned int>    m_nHeight   ;   ///< estimated high level
-        mutable stat                m_Stat              ;   ///< internal statistics
+        item_counter                m_ItemCounter   ///< item counter
+        random_level_generator      m_RandomLevelGen; ///< random level generator instance
+        atomics::atomic<unsigned int> m_nHeight;      ///< estimated high level
+        mutable stat                m_Stat;           ///< internal statistics
 
     protected:
         //@cond
@@ -994,16 +969,15 @@ namespace cds { namespace intrusive {
         }
 
         /// Returns a forward const iterator addressing the first element in a set
-        //@{
         const_iterator begin() const
         {
             return const_iterator( *m_Head.head() );
         }
+        /// Returns a forward const iterator addressing the first element in a set
         const_iterator cbegin() const
         {
             return const_iterator( *m_Head.head() );
         }
-        //@}
 
         /// Returns a forward iterator that addresses the location succeeding the last element in a set.
         iterator end()
@@ -1012,16 +986,15 @@ namespace cds { namespace intrusive {
         }
 
         /// Returns a forward const iterator that addresses the location succeeding the last element in a set.
-        //@{
         const_iterator end() const
         {
             return const_iterator();
         }
+        /// Returns a forward const iterator that addresses the location succeeding the last element in a set.
         const_iterator cend() const
         {
             return const_iterator();
         }
-        //@}
 
     public:
         /// Inserts new node
@@ -1051,8 +1024,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
-            The user-defined functor is called only if the inserting is success and may be passed by reference
-            using \p std::ref
+            The user-defined functor is called only if the inserting is success.
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -1117,14 +1089,11 @@ namespace cds { namespace intrusive {
             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.
 
-            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.
-
-            You can pass \p func argument by value or by reference using \p std::ref.
-
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
             already is in the set.
+
+            @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Func>
         std::pair<bool, bool> ensure( value_type& val, Func func )
@@ -1178,12 +1147,12 @@ namespace cds { namespace intrusive {
             The function searches the item \p val in the set and unlink it from the set
             if it is found and is equal to \p val.
 
-            Difference between \ref erase and \p unlink functions: \p erase finds <i>a key</i>
-            and deletes the item found. \p unlink finds an item by key and deletes it
+            Difference between \p erase() and \p %unlink() functions: \p %erase() finds <i>a key</i>
+            and deletes the item found. \p %unlink() finds an item by key and deletes it
             only if \p val is an item of that set, i.e. the pointer to item found
             is equal to <tt> &val </tt>.
 
-            The \ref disposer specified in \p Traits class template parameter is called
+            The \p disposer specified in \p Traits class template parameter is called
             by garbage collector \p GC asynchronously.
 
             The function returns \p true if success and \p false otherwise.
@@ -1224,7 +1193,7 @@ namespace cds { namespace intrusive {
             Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type.
 
             The \ref disposer specified in \p Traits class template parameter is called automatically
-            by garbage collector \p GC specified in class' template parameters when returned \ref guarded_ptr object
+            by garbage collector \p GC specified in class' template parameters when returned \p guarded_ptr object
             will be destroyed or released.
             @note Each \p guarded_ptr object uses the GC's guard that can be limited resource.
 
@@ -1274,8 +1243,8 @@ namespace cds { namespace intrusive {
             During unlinking, a concurrent thread may insert an item with key less than leftmost item's key.
             So, the function returns the item with minimum key at the moment of list traversing.
 
-            The \ref disposer specified in \p Traits class template parameter is called
-            by garbage collector \p GC automatically when returned \ref guarded_ptr object
+            The \p disposer specified in \p Traits class template parameter is called
+            by garbage collector \p GC automatically when returned \p guarded_ptr object
             will be destroyed or released.
             @note Each \p guarded_ptr object uses the GC's guard that can be limited resource.
 
@@ -1309,14 +1278,14 @@ namespace cds { namespace intrusive {
             During unlinking, a concurrent thread may insert an item with key greater than rightmost item's key.
             So, the function returns the item with maximum key at the moment of list traversing.
 
-            The \ref disposer specified in \p Traits class template parameter is called
+            The \p disposer specified in \p Traits class template parameter is called
             by garbage collector \p GC asynchronously when returned \ref guarded_ptr object
             will be destroyed or released.
             @note Each \p guarded_ptr object uses the GC's guard that can be limited resource.
 
             Usage:
             \code
-            typedef cds::intrusive::SkipListSet< cds::gc::HP, foo, my_traits >  skip_list;
+            typedef cds::intrusive::SkipListSet< cds::gc::HP, foo, my_traits > skip_list;
             skip_list theList;
             // ...
             {
@@ -1336,16 +1305,16 @@ namespace cds { namespace intrusive {
 
         /// Deletes the item from the set
         /** \anchor cds_intrusive_SkipListSet_hp_erase
-            The function searches an item with key equal to \p val in the set,
+            The function searches an item with key equal to \p key in the set,
             unlinks it from the set, and returns \p true.
-            If the item with key equal to \p val is not found the function return \p false.
+            If the item with key equal to \p key is not found the function return \p false.
 
             Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type.
         */
         template <typename Q>
-        bool erase( Q const& val )
+        bool erase( Q const& key )
         {
-            return erase_( val, key_comparator(), [](value_type const&) {} );
+            return erase_( key, key_comparator(), [](value_type const&) {} );
         }
 
         /// Deletes the item from the set with comparing functor \p pred
@@ -1358,14 +1327,14 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool erase_with( Q const& val, Less pred )
+        bool erase_with( Q const& key, Less pred )
         {
-            return erase_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type const&) {} );
+            return erase_( key, cds::opt::details::make_comparator_from_less<Less>(), [](value_type const&) {} );
         }
 
         /// Deletes the item from the set
         /** \anchor cds_intrusive_SkipListSet_hp_erase_func
-            The function searches an item with key equal to \p val in the set,
+            The function searches an item with key equal to \p key in the set,
             call \p f functor with item found, unlinks it from the set, and returns \p true.
             The \ref disposer specified in \p Traits class template parameter is called
             by garbage collector \p GC asynchronously.
@@ -1376,16 +1345,15 @@ namespace cds { namespace intrusive {
                 void operator()( value_type const& item );
             };
             \endcode
-            The functor can be passed by reference with <tt>boost:ref</tt>
 
-            If the item with key equal to \p val is not found the function return \p false.
+            If the item with key equal to \p key is not found the function return \p false.
 
             Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type.
         */
         template <typename Q, typename Func>
-        bool erase( Q const& val, Func f )
+        bool erase( Q const& key, Func f )
         {
-            return erase_( val, key_comparator(), f );
+            return erase_( key, key_comparator(), f );
         }
 
         /// Deletes the item from the set with comparing functor \p pred
@@ -1398,44 +1366,39 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less, typename Func>
-        bool erase_with( Q const& val, Less pred, Func f )
+        bool erase_with( Q const& key, Less pred, Func f )
         {
-            return erase_( val, cds::opt::details::make_comparator_from_less<Less>(), f );
+            return erase_( key, cds::opt::details::make_comparator_from_less<Less>(), f );
         }
 
-        /// Finds the key \p val
+        /// Finds \p key
         /** \anchor cds_intrusive_SkipListSet_hp_find_func
-            The function searches the item with key equal to \p val and calls the functor \p f for item found.
+            The function searches the item with key equal to \p key and calls the functor \p f for item found.
             The interface of \p Func functor is:
             \code
             struct functor {
-                void operator()( value_type& item, Q& val );
+                void operator()( value_type& item, Q& key );
             };
             \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
-            You can pass \p f argument by value or by reference using \p std::ref.
+            where \p item is the item found, \p key is the <tt>find</tt> function argument.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
             The functor does not serialize simultaneous access to the set \p item. If such access is
-            possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
-
-            The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
-            can modify both arguments.
+            possible you must provide your own synchronization on item level to exclude unsafe item modifications.
 
             Note the compare 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 returns \p true if \p val is found, \p false otherwise.
+            The function returns \p true if \p key is found, \p false otherwise.
         */
         template <typename Q, typename Func>
-        bool find( Q& val, Func f )
+        bool find( Q& key, Func f )
         {
-            return find_with_( val, key_comparator(), f );
+            return find_with_( key, key_comparator(), f );
         }
 
-        /// Finds the key \p val with \p pred predicate for comparing
+        /// Finds the key \p key with \p pred predicate for comparing
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_hp_find_func "find(Q&, Func)"
             but \p pred is used for key compare.
@@ -1445,69 +1408,26 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less, typename Func>
-        bool find_with( Q& val, Less pred, Func f )
-        {
-            return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), f );
-        }
-
-        /// Finds the key \p val
-        /** \anchor cds_intrusive_SkipListSet_hp_find_cfunc
-            The function searches the item with key equal to \p val and calls the functor \p f for item found.
-            The interface of \p Func functor is:
-            \code
-            struct functor {
-                void operator()( value_type& item, Q const& val );
-            };
-            \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
-            You can pass \p f argument by value or by reference using \p std::ref.
-
-            The functor can change non-key fields of \p item. Note that the functor is only guarantee
-            that \p item cannot be disposed during functor is executing.
-            The functor does not serialize simultaneous access to the set \p item. If such access is
-            possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
-
-            Note the compare 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 returns \p true if \p val is found, \p false otherwise.
-        */
-        template <typename Q, typename Func>
-        bool find( Q const& val, Func f )
-        {
-            return find_with_( val, key_comparator(), f );
-        }
-
-        /// Finds the key \p val with \p pred predicate for comparing
-        /**
-            The function is an analog of \ref cds_intrusive_SkipListSet_hp_find_cfunc "find(Q const&, Func)"
-            but \p pred is used for key compare.
-            \p Less functor has the semantics like \p std::less but should take arguments of type \ref value_type and \p Q
-            in any order.
-            \p pred must imply the same element order as the comparator used for building the set.
-        */
-        template <typename Q, typename Less, typename Func>
-        bool find_with( Q const& val, Less pred, Func f )
+        bool find_with( Q& key, Less pred, Func f )
         {
-            return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), f );
+            return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), f );
         }
 
-        /// Finds the key \p val
+        /// Finds \p key
         /** \anchor cds_intrusive_SkipListSet_hp_find_val
-            The function searches the item with key equal to \p val
+            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 compare 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 & val )
+        bool find( Q const& key )
         {
-            return find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
+            return find_with_( key, key_comparator(), [](value_type& , Q const& ) {} );
         }
 
-        /// Finds the key \p val with comparing functor \p pred
+        /// Finds \p key with comparing functor \p pred
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_hp_find_val "find(Q const&)"
             but \p pred is used for comparing the keys.
@@ -1516,17 +1436,17 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool find_with( Q const& val, Less pred )
+        bool find_with( Q const& key, Less pred )
         {
-            return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
+            return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
         }
 
-        /// Finds the key \p val and return the item found
+        /// Finds \p key and return the item found
         /** \anchor cds_intrusive_SkipListSet_hp_get
-            The function searches the item with key equal to \p val
+            The function searches the item with key equal to \p key
             and assigns the item found to guarded pointer \p ptr.
-            The function returns \p true if \p val is found, and \p false otherwise.
-            If \p val is not found the \p ptr parameter is not changed.
+            The function returns \p true if \p key is found, and \p false otherwise.
+            If \p key is not found the \p ptr parameter is not changed.
 
             The \ref disposer specified in \p Traits class template parameter is called
             by garbage collector \p GC asynchronously when returned \ref guarded_ptr object
@@ -1552,12 +1472,12 @@ namespace cds { namespace intrusive {
             should accept a parameter of type \p Q that can be not the same as \p value_type.
         */
         template <typename Q>
-        bool get( guarded_ptr& ptr, Q const& val )
+        bool get( guarded_ptr& ptr, Q const& key )
         {
-            return get_with_( ptr.guard(), val, key_comparator() );
+            return get_with_( ptr.guard(), key, key_comparator() );
         }
 
-        /// Finds the key \p val and return the item found
+        /// Finds \p key and return the item found
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_hp_get "get( guarded_ptr& ptr, Q const&)"
             but \p pred is used for comparing the keys.
@@ -1567,17 +1487,17 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool get_with( guarded_ptr& ptr, Q const& val, Less pred )
+        bool get_with( guarded_ptr& ptr, Q const& key, Less pred )
         {
-            return get_with_( ptr.guard(), val, cds::opt::details::make_comparator_from_less<Less>() );
+            return get_with_( ptr.guard(), key, cds::opt::details::make_comparator_from_less<Less>() );
         }
 
         /// Returns item count in the set
         /**
             The value returned depends on item counter type provided by \p Traits template parameter.
-            If it is atomicity::empty_item_counter this function always returns 0.
-            Therefore, the function is not suitable for checking the set emptiness, use \ref empty
-            member function for this purpose.
+            If it is \p atomicity::empty_item_counter this function always returns 0.
+            Therefore, the function is not suitable for checking the set emptiness, use \p empty()
+            for this purpose.
         */
         size_t size() const
         {
@@ -1590,7 +1510,7 @@ namespace cds { namespace intrusive {
             return m_Head.head()->next( 0 ).load( memory_model::memory_order_relaxed ) == nullptr;
         }
 
-        /// Clears the set (non-atomic)
+        /// Clears the set (noatomic)
         /**
             The function unlink all items from the set.
             The function is not atomic, i.e., in multi-threaded environment with parallel insertions
@@ -1620,7 +1540,6 @@ namespace cds { namespace intrusive {
         {
             return m_Stat;
         }
-
     };
 
 }} // namespace cds::intrusive
index 6326cd1184eceff861b2bf1b2bc6e45ac4fd7415..fe209b9669466fa7d2842f0e1c1cfec4a59c34b2 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <type_traits>
 #include <memory>
-#include <functional>   // ref
 #include <cds/gc/nogc.h>
 #include <cds/intrusive/details/skip_list_base.h>
 #include <cds/opt/compare.h>
@@ -19,16 +18,16 @@ namespace cds { namespace intrusive {
         class node< cds::gc::nogc, Tag >
         {
         public:
-            typedef cds::gc::nogc   gc          ;   ///< Garbage collector
-            typedef Tag             tag         ;   ///< tag
+            typedef cds::gc::nogc   gc;  ///< Garbage collector
+            typedef Tag             tag; ///< tag
 
             typedef atomics::atomic<node * > atomic_ptr;
-            typedef atomic_ptr                  tower_item_type;
+            typedef atomic_ptr tower_item_type;
 
         protected:
-            atomic_ptr      m_pNext     ;   ///< Next item in bottom-list (list at level 0)
-            unsigned int    m_nHeight   ;   ///< Node height (size of m_arrNext array). For node at level 0 the height is 1.
-            atomic_ptr *    m_arrNext   ;   ///< Array of next items for levels 1 .. m_nHeight - 1. For node at level 0 \p m_arrNext is \p nullptr
+            atomic_ptr      m_pNext;   ///< Next item in bottom-list (list at level 0)
+            unsigned int    m_nHeight; ///< Node height (size of m_arrNext array). For node at level 0 the height is 1.
+            atomic_ptr *    m_arrNext; ///< Array of next items for levels 1 .. m_nHeight - 1. For node at level 0 \p m_arrNext is \p nullptr
 
         public:
             /// Constructs a node of height 1 (a bottom-list node)
@@ -180,7 +179,7 @@ namespace cds { namespace intrusive {
                 return *this;
             }
 
-            iterator& operator = (const iterator& src)
+            iterator& operator =(const iterator& src)
             {
                 m_pNode = src.m_pNode;
                 return *this;
@@ -204,38 +203,17 @@ namespace cds { namespace intrusive {
     /** @ingroup cds_intrusive_map
         @anchor cds_intrusive_SkipListSet_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 list item.
 
         See \ref cds_intrusive_SkipListSet_hp "SkipListSet" for description of skip-list.
 
         <b>Template arguments</b> :
-        - \p T - type to be stored in the set. The type must be based on skip_list::node (for skip_list::base_hook)
-            or it must have a member of type skip_list::node (for skip_list::member_hook).
-        - \p Traits - type traits. See skip_list::type_traits for explanation.
-
-        It is possible to declare option-based list with cds::intrusive::skip_list::make_traits metafunction istead of \p Traits template
-        argument.
-        Template argument list \p Options of cds::intrusive::skip_list::make_traits metafunction are:
-        - opt::hook - hook used. Possible values are: skip_list::base_hook, skip_list::member_hook, skip_list::traits_hook.
-            If the option is not specified, <tt>skip_list::base_hook<></tt> and gc::HP is used.
-        - opt::compare - key comparison functor. No default functor is provided.
-            If the option is not specified, the opt::less is used.
-        - opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
-        - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that is no item counting.
-        - opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default)
-            or opt::v::sequential_consistent (sequentially consisnent memory model).
-        - skip_list::random_level_generator - random level generator. Can be skip_list::xorshift, skip_list::turbo_pascal or
-            user-provided one. See skip_list::random_level_generator option description for explanation.
-            Default is \p %skip_list::turbo_pascal.
-        - opt::allocator - although the skip-list is an intrusive container,
-            an allocator should be provided to maintain variable randomly-calculated height of the node
-            since the node can contain up to 32 next pointers. The allocator option is used to allocate an array of next pointers
-            for nodes which height is more than 1. Default is \ref CDS_DEFAULT_ALLOCATOR.
-        - opt::back_off - back-off strategy used. If the option is not specified, the cds::backoff::Default is used.
-        - opt::stat - internal statistics. Available types: skip_list::stat, skip_list::empty_stat (the default)
-        - opt::disposer - the functor used for dispose removed items. Default is opt::v::empty_disposer.
-            The disposer is used only in object destructor and in \ref clear function.
+        - \p T - type to be stored in the set. The type must be based on \p skip_list::node (for \p skip_list::base_hook)
+            or it must have a member of type \p skip_list::node (for \p skip_list::member_hook).
+        - \p Traits - type traits, default is \p skip_list::traits.
+            It is possible to declare option-based list with \p cds::intrusive::skip_list::make_traits metafunction 
+            istead of \p Traits template argument.
 
         <b>Iterators</b>
 
@@ -268,9 +246,9 @@ namespace cds { namespace intrusive {
 
         <b>How to use</b>
 
-        You should incorporate skip_list::node into your struct \p T and provide
-        appropriate skip_list::type_traits::hook in your \p Traits template parameters. Usually, for \p Traits you
-        define a struct based on skip_list::type_traits.
+        You should incorporate \p skip_list::node into your struct \p T and provide
+        appropriate \p skip_list::traits::hook in your \p Traits template parameters. Usually, for \p Traits you
+        define a struct based on \p skip_list::traits.
 
         Example for base hook:
         \code
@@ -305,15 +283,15 @@ namespace cds { namespace intrusive {
         };
 
 
-        // Declare type_traits
-        struct my_traits: public cds::intrusive::skip_list::type_traits
+        // Declare traits
+        struct my_traits: public cds::intrusive::skip_list::traits
         {
-            typedef cds::intrusive::skip_list::base_hook< cds::opt::gc< cds::gc::nogc > >   hook;
+            typedef cds::intrusive::skip_list::base_hook< cds::opt::gc< cds::gc::nogc > > hook;
             typedef my_data_cmp compare;
         };
 
         // Declare skip-list set type
-        typedef cds::intrusive::SkipListSet< cds::gc::nogc, my_data, my_traits >     traits_based_set;
+        typedef cds::intrusive::SkipListSet< cds::gc::nogc, my_data, my_traits > traits_based_set;
         \endcode
 
         Equivalent option-based code:
@@ -336,14 +314,12 @@ namespace cds { namespace intrusive {
                 ,cds::intrusive::opt::compare< my_data_cmp >
             >::type
         > option_based_set;
-
         \endcode
-
     */
     template <
        typename T
 #ifdef CDS_DOXYGEN_INVOKED
-       ,typename Traits = skip_list::type_traits
+       ,typename Traits = skip_list::traits
 #else
        ,typename Traits
 #endif
@@ -351,32 +327,32 @@ namespace cds { namespace intrusive {
     class SkipListSet< cds::gc::nogc, T, Traits >
     {
     public:
-        typedef T       value_type      ;   ///< type of value stored in the skip-list
-        typedef Traits  options         ;   ///< Traits template parameter
+        typedef cds::gc::nogc  gc;   ///< No garbage collector is used
+        typedef T       value_type;  ///< type of value stored in the skip-list
+        typedef Traits  traits;      ///< Traits template parameter
 
-        typedef typename options::hook      hook        ;   ///< hook type
-        typedef typename hook::node_type    node_type   ;   ///< node type
+        typedef typename traits::hook    hook;      ///< hook type
+        typedef typename hook::node_type node_type; ///< node type
 
 #   ifdef CDS_DOXYGEN_INVOKED
-        typedef implementation_defined key_comparator  ;    ///< key comparison functor based on opt::compare and opt::less option setter.
+        typedef implementation_defined key_comparator; ///< key comparison functor based on \p Traits::compare and \p Traits::less
 #   else
-        typedef typename opt::details::make_comparator< value_type, options >::type key_comparator;
+        typedef typename opt::details::make_comparator< value_type, traits >::type key_comparator;
 #   endif
-        typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ;    ///< node traits
+        typedef typename get_node_traits< value_type, node_type, hook>::type node_traits; ///< node traits
 
-        typedef cds::gc::nogc  gc          ;   ///< No garbage collector is used
-        typedef typename options::item_counter  item_counter ;   ///< Item counting policy used
-        typedef typename options::memory_model  memory_model;   ///< Memory ordering. See cds::opt::memory_model option
-        typedef typename options::random_level_generator    random_level_generator  ;   ///< random level generator
-        typedef typename options::allocator     allocator_type  ;   ///< allocator for maintaining array of next pointers of the node
-        typedef typename options::back_off      back_off    ;   ///< Back-off trategy
-        typedef typename options::stat          stat        ;   ///< internal statistics type
-        typedef typename options::disposer      disposer    ;   ///< disposer used
+        typedef typename traits::item_counter  item_counter;   ///< Item counting policy
+        typedef typename traits::memory_model  memory_model;   ///< Memory ordering. See \p cds::opt::memory_model option
+        typedef typename traits::random_level_generator    random_level_generator  ;   ///< random level generator
+        typedef typename traits::allocator     allocator_type;   ///< allocator for maintaining array of next pointers of the node
+        typedef typename traits::back_off      back_off;   ///< Back-off strategy
+        typedef typename traits::stat          stat;       ///< internal statistics type
+        typedef typename traits::disposer      disposer;   ///< disposer
 
         /// Max node height. The actual node height should be in range <tt>[0 .. c_nMaxHeight)</tt>
         /**
             The max height is specified by \ref skip_list::random_level_generator "random level generator" constant \p m_nUpperBound
-            but it should be no more than 32 (\ref skip_list::c_nHeightLimit).
+            but it should be no more than 32 (\p skip_list::c_nHeightLimit).
         */
         static unsigned int const c_nMaxHeight = std::conditional<
             (random_level_generator::c_nUpperBound <= skip_list::c_nHeightLimit),
@@ -389,16 +365,16 @@ namespace cds { namespace intrusive {
         //@endcond
 
     protected:
-        typedef typename node_type::atomic_ptr   atomic_node_ptr ;   ///< Atomic node pointer
+        typedef typename node_type::atomic_ptr  atomic_node_ptr;   ///< Atomic node pointer
 
     protected:
         //@cond
         typedef skip_list::details::intrusive_node_builder< node_type, atomic_node_ptr, allocator_type > intrusive_node_builder;
 
         typedef typename std::conditional<
-            std::is_same< typename options::internal_node_builder, cds::opt::none >::value
+            std::is_same< typename traits::internal_node_builder, cds::opt::none >::value
             ,intrusive_node_builder
-            ,typename options::internal_node_builder
+            ,typename traits::internal_node_builder
         >::type node_builder;
 
         typedef std::unique_ptr< node_type, typename node_builder::node_disposer >    scoped_node_ptr;
@@ -438,12 +414,12 @@ namespace cds { namespace intrusive {
         //@endcond
 
     protected:
-        head_node                   m_Head  ;   ///< head tower (max height)
+        head_node                   m_Head;   ///< head tower (max height)
 
-        item_counter                m_ItemCounter       ;   ///< item counter
-        random_level_generator      m_RandomLevelGen    ;   ///< random level generator instance
-        atomics::atomic<unsigned int>    m_nHeight   ;   ///< estimated high level
-        mutable stat                m_Stat              ;   ///< internal statistics
+        item_counter                m_ItemCounter   ///< item counter
+        random_level_generator      m_RandomLevelGen; ///< random level generator instance
+        atomics::atomic<unsigned int>    m_nHeight;   ///< estimated high level
+        mutable stat                m_Stat;           ///< internal statistics
 
     protected:
         //@cond
@@ -616,16 +592,15 @@ namespace cds { namespace intrusive {
         }
 
         /// Returns a forward const iterator addressing the first element in a set
-        //@{
         const_iterator begin() const
         {
             return const_iterator( *m_Head.head() );
         }
+        /// Returns a forward const iterator addressing the first element in a set
         const_iterator cbegin() const
         {
             return const_iterator( *m_Head.head() );
         }
-        //@}
 
         /// Returns a forward iterator that addresses the location succeeding the last element in a set.
         iterator end()
@@ -634,16 +609,15 @@ namespace cds { namespace intrusive {
         }
 
         /// Returns a forward const iterator that addresses the location succeeding the last element in a set.
-        //@{
         const_iterator end() const
         {
             return const_iterator();
         }
+        /// Returns a forward const iterator that addresses the location succeeding the last element in a set.
         const_iterator cend() const
         {
             return const_iterator();
         }
-        //@}
 
     protected:
         //@cond
@@ -728,6 +702,8 @@ namespace cds { namespace intrusive {
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
             already is in the set.
+
+            @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Func>
         std::pair<bool, bool> ensure( value_type& val, Func func )
@@ -773,16 +749,16 @@ namespace cds { namespace intrusive {
             }
         }
 
-        /// Finds the key \p val
+        /// Finds \p key
         /** \anchor cds_intrusive_SkipListSet_nogc_find_func
-            The function searches the item with key equal to \p val and calls the functor \p f for item found.
+            The function searches the item with key equal to \p key and calls the functor \p f for item found.
             The interface of \p Func functor is:
             \code
             struct functor {
-                void operator()( value_type& item, Q& val );
+                void operator()( value_type& item, Q& key );
             };
             \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
+            where \p item is the item found, \p key is the <tt>find</tt> function argument.
 
             You can pass \p f argument by value or by reference using \p std::ref.
 
@@ -791,21 +767,21 @@ namespace cds { namespace intrusive {
             The functor does not serialize simultaneous access to the set \p item. If such access is
             possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
 
-            The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
+            The \p key argument is non-const since it can be used as \p f functor destination i.e., the functor
             can modify both arguments.
 
             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 returns \p true if \p val is found, \p false otherwise.
+            The function returns \p true if \p key is found, \p false otherwise.
         */
         template <typename Q, typename Func>
-        bool find( Q& val, Func f ) const
+        bool find( Q& key, Func f ) const
         {
-            return find_with_( val, key_comparator(), f ) != nullptr;
+            return find_with_( key, key_comparator(), f ) != nullptr;
         }
 
-        /// Finds the key \p val using \p pred predicate for comparing
+        /// Finds the key \p key using \p pred predicate for comparing
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_nogc_find_func "find(Q&, Func)"
             but \p pred predicate is used for key compare.
@@ -813,71 +789,29 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less, typename Func>
-        bool find_with( Q& val, Less pred, Func f ) const
-        {
-            return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), f ) != nullptr;
-        }
-
-        /// Finds the key \p val
-        /** \anchor cds_intrusive_SkipListSet_nogc_find_cfunc
-            The function searches the item with key equal to \p val and calls the functor \p f for item found.
-            The interface of \p Func functor is:
-            \code
-            struct functor {
-                void operator()( value_type& item, Q const& val );
-            };
-            \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
-            You can pass \p f argument by value or by reference using \p std::ref.
-
-            The functor can change non-key fields of \p item. Note that the functor is only guarantee
-            that \p item cannot be disposed during functor is executing.
-            The functor does not serialize simultaneous access to the set \p item. If such access is
-            possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
-
-            Note the hash functor specified for class \p Traits template parameter
-            should accept a parameter of type \p Q that can be not the same as \p value_type.
-
-            The function returns \p true if \p val is found, \p false otherwise.
-        */
-        template <typename Q, typename Func>
-        bool find( Q const& val, Func f ) const
-        {
-            return find_with_( val, key_comparator(), f ) != nullptr;
-        }
-
-        /// Finds the key \p val using \p pred predicate for comparing
-        /**
-            The function is an analog of \ref cds_intrusive_SkipListSet_nogc_find_cfunc "find(Q const&, Func)"
-            but \p pred predicate is used for key compare.
-            \p Less has the interface like \p std::less.
-            \p pred must imply the same element order as the comparator used for building the set.
-        */
-        template <typename Q, typename Less, typename Func>
-        bool find_with( Q const& val, Less pred, Func f ) const
+        bool find_with( Q& key, Less pred, Func f ) const
         {
-            return find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), f ) != nullptr;
+            return find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), f ) != nullptr;
         }
 
-        /// Finds the key \p val
+        /// Finds \p key
         /** \anchor cds_intrusive_SkipListSet_nogc_find_val
-            The function searches the item with key equal to \p val
+            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>
-        value_type * find( Q const& val ) const
+        value_type * find( Q const& key ) const
         {
-            node_type * pNode = find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
+            node_type * pNode = find_with_( key, key_comparator(), [](value_type& , Q const& ) {} );
             if ( pNode )
                 return node_traits::to_value_ptr( pNode );
             return nullptr;
         }
 
-        /// Finds the key \p val using \p pred predicate for comparing
+        /// Finds \p key using \p pred predicate for comparing
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_nogc_find_val "find(Q const&)"
             but \p pred predicate is used for key compare.
@@ -885,9 +819,9 @@ namespace cds { namespace intrusive {
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        value_type * find_with( Q const& val, Less pred ) const
+        value_type * find_with( Q const& key, Less pred ) const
         {
-            node_type * pNode = find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
+            node_type * pNode = find_with_( key, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
             if ( pNode )
                 return node_traits::to_value_ptr( pNode );
             return nullptr;
@@ -951,9 +885,8 @@ namespace cds { namespace intrusive {
         /// Returns item count in the set
         /**
             The value returned depends on item counter type provided by \p Traits template parameter.
-            If it is atomicity::empty_item_counter this function always returns 0.
-            The function is not suitable for checking the set emptiness, use \ref empty
-            member function for this purpose.
+            For \p atomicity::empty_item_counter the function always returns 0.
+            The function is not suitable for checking the set emptiness, use \p empty().
         */
         size_t size() const
         {
index 4a61dfc85f14e0bd194e35d92a36608772859c0a..b8749b85325418fd54c5c23eb36d657d394ceef5 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <type_traits>
 #include <memory>
-#include <functional>   // ref
 #include <cds/intrusive/details/skip_list_base.h>
 #include <cds/opt/compare.h>
 #include <cds/urcu/details/check_deadlock.h>
@@ -28,25 +27,25 @@ namespace cds { namespace intrusive {
             // Mark bits:
             //  bit 0 - the item is logically deleted
             //  bit 1 - the item is extracted (only for level 0)
-            typedef cds::details::marked_ptr<node, 3>   marked_ptr          ;   ///< marked pointer
-            typedef atomics::atomic< marked_ptr >    atomic_marked_ptr   ;   ///< atomic marked pointer
-            typedef atomic_marked_ptr                   tower_item_type;
+            typedef cds::details::marked_ptr<node, 3> marked_ptr;        ///< marked pointer
+            typedef atomics::atomic< marked_ptr >     atomic_marked_ptr; ///< atomic marked pointer
+            typedef atomic_marked_ptr                 tower_item_type;
 
         protected:
-            atomic_marked_ptr       m_pNext     ;   ///< Next item in bottom-list (list at level 0)
+            atomic_marked_ptr       m_pNext;     ///< Next item in bottom-list (list at level 0)
         public:
-            node *                  m_pDelChain ;   ///< Deleted node chain (local for a thread)
+            node *                  m_pDelChain; ///< Deleted node chain (local for a thread)
 #       ifdef _DEBUG
             bool volatile           m_bLinked;
             bool volatile           m_bUnlinked;
 #       endif
         protected:
-            unsigned int            m_nHeight   ;   ///< Node height (size of m_arrNext array). For node at level 0 the height is 1.
-            atomic_marked_ptr *     m_arrNext   ;   ///< Array of next items for levels 1 .. m_nHeight - 1. For node at level 0 \p m_arrNext is \p nullptr
+            unsigned int            m_nHeight;   ///< Node height (size of m_arrNext array). For node at level 0 the height is 1.
+            atomic_marked_ptr *     m_arrNext;   ///< Array of next items for levels 1 .. m_nHeight - 1. For node at level 0 \p m_arrNext is \p nullptr
 
         public:
             /// Constructs a node of height 1 (a bottom-list node)
-            node()
+            CDS_CONSTEXPR node()
                 : m_pNext( nullptr )
                 , m_pDelChain( nullptr )
 #       ifdef _DEBUG
@@ -101,7 +100,7 @@ namespace cds { namespace intrusive {
                 assert( nLevel < height() );
                 assert( nLevel == 0 || (nLevel > 0 && m_arrNext != nullptr) );
 
-                return nLevel ? m_arrNext[ nLevel - 1] : m_pNext;
+                return nLevel ? m_arrNext[nLevel - 1] : m_pNext;
             }
 
             /// Access to element of next pointer array (const version)
@@ -110,7 +109,7 @@ namespace cds { namespace intrusive {
                 assert( nLevel < height() );
                 assert( nLevel == 0 || nLevel > 0 && m_arrNext != nullptr );
 
-                return nLevel ? m_arrNext[ nLevel - 1] : m_pNext;
+                return nLevel ? m_arrNext[nLevel - 1] : m_pNext;
             }
 
             /// Access to element of next pointer array (same as \ref next function)
@@ -313,39 +312,14 @@ namespace cds { namespace intrusive {
         The lock-free variant of skip-list is implemented according to book
             - [2008] M.Herlihy, N.Shavit "The Art of Multiprocessor Programming",
                 chapter 14.4 "A Lock-Free Concurrent Skiplist".
-        \note The algorithm described in this book cannot be directly adapted for C++ (roughly speaking,
-        the algo contains a lot of bugs). The \b libcds implementation applies the approach discovered
-        by M.Michael in his \ref cds_intrusive_MichaelList_hp "lock-free linked list".
 
         <b>Template arguments</b>:
             - \p RCU - one of \ref cds_urcu_gc "RCU type"
             - \p T - type to be stored in the list. The type must be based on \p skip_list::node (for \p skip_list::base_hook)
                 or it must have a member of type \p skip_list::node (for \p skip_list::member_hook).
-            - \p Traits - type traits. See \p skip_list::type_traits (the default) for explanation.
-
-        It is possible to declare option-based list with \p cds::intrusive::skip_list::make_traits metafunction instead of \p Traits template
-        argument.
-        Template argument list \p Options of \p %cds::intrusive::skip_list::make_traits metafunction is:
-        - \p opt::hook - hook used. Possible values are: \p skip_list::base_hook, \p skip_list::member_hook, \p skip_list::traits_hook.
-            If the option is not specified, <tt>skip_list::base_hook<></tt> is used.
-        - \p opt::compare - key comparison functor. No default functor is provided.
-            If the option is not specified, the \p opt::less is used.
-        - \p opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
-        - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. Due the nature
-            of GC schema the disposer may be called asynchronously.
-        - \p opt::item_counter - the type of item counting feature. Default is \p atomicity::empty_item_counter that is no item counting.
-        - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
-            or \p opt::v::sequential_consistent (sequentially consisnent memory model).
-        - \p skip_list::random_level_generator - random level generator. Can be \p skip_list::xorshift, \p skip_list::turbo_pascal or
-            user-provided one. See \p skip_list::random_level_generator option description for explanation.
-            Default is \p %skip_list::turbo_pascal.
-        - \p opt::allocator - although the skip-list is an intrusive container,
-            an allocator should be provided to maintain variable randomly-calculated height of the node
-            since the node can contain up to 32 next pointers. The allocator option is used to allocate an array of next pointers
-            for nodes which height is more than 1. Default is \ref CDS_DEFAULT_ALLOCATOR.
-        - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used.
-        - \p opt::stat - internal statistics. Available types: \p skip_list::stat, \p skip_list::empty_stat (the default)
-        - \p opt::rcu_check_deadlock - a deadlock checking policy. Default is \p opt::v::rcu_throw_deadlock
+            - \p Traits - set traits, default is \p skip_list::type_traits
+                It is possible to declare option-based list with \p cds::intrusive::skip_list::make_traits metafunction 
+                instead of \p Traits template argument.
 
         @note Before including <tt><cds/intrusive/skip_list_rcu.h></tt> you should include appropriate RCU header file,
         see \ref cds_urcu_gc "RCU type" for list of existing RCU class and corresponding header files.
@@ -378,7 +352,7 @@ namespace cds { namespace intrusive {
 
         // Traits for your skip-list.
         // At least, you should define cds::opt::less or cds::opt::compare for Foo struct
-        struct my_traits: public cds::intrusive::skip_list::type_traits
+        struct my_traits: public cds::intrusive::skip_list::traits
         {
             // ...
         };
@@ -428,8 +402,8 @@ namespace cds { namespace intrusive {
         <b>How to use</b>
 
         You should incorporate skip_list::node into your struct \p T and provide
-        appropriate skip_list::type_traits::hook in your \p Traits template parameters. Usually, for \p Traits you
-        define a struct based on \p skip_list::type_traits.
+        appropriate skip_list::traits::hook in your \p Traits template parameters. Usually, for \p Traits you
+        define a struct based on \p skip_list::traits.
 
         Example for <tt>cds::urcu::general_buffered<></tt> RCU and base hook:
         \code
@@ -470,9 +444,8 @@ namespace cds { namespace intrusive {
             }
         };
 
-
-        // Declare type_traits
-        struct my_traits: public cds::intrusive::skip_list::type_traits
+        // Declare traits
+        struct my_traits: public cds::intrusive::skip_list::traits
         {
             typedef cds::intrusive::skip_list::base_hook< cds::opt::gc< rcu_type > >   hook;
             typedef my_data_cmp compare;
@@ -511,7 +484,7 @@ namespace cds { namespace intrusive {
         class RCU
        ,typename T
 #ifdef CDS_DOXYGEN_INVOKED
-       ,typename Traits = skip_list::type_traits
+       ,typename Traits = skip_list::traits
 #else
        ,typename Traits
 #endif
@@ -519,30 +492,30 @@ namespace cds { namespace intrusive {
     class SkipListSet< cds::urcu::gc< RCU >, T, Traits >
     {
     public:
-        typedef T       value_type      ;   ///< type of value stored in the skip-list
-        typedef Traits  options         ;   ///< Traits template parameter
+        typedef cds::urcu::gc< RCU > gc; ///< Garbage collector
+        typedef T       value_type;      ///< type of value stored in the skip-list
+        typedef Traits  traits;          ///< Traits template parameter
 
-        typedef typename options::hook      hook        ;   ///< hook type
-        typedef typename hook::node_type    node_type   ;   ///< node type
+        typedef typename traits::hook    hook;      ///< hook type
+        typedef typename hook::node_type node_type; ///< node type
 
 #   ifdef CDS_DOXYGEN_INVOKED
-        typedef implementation_defined key_comparator  ;    ///< key comparison functor based on opt::compare and opt::less option setter.
+        typedef implementation_defined key_comparator  ;    ///< key comparison functor based on \p Traits::compare and \p Traits::less
 #   else
-        typedef typename opt::details::make_comparator< value_type, options >::type key_comparator;
+        typedef typename opt::details::make_comparator< value_type, traits >::type key_comparator;
 #   endif
 
-        typedef typename options::disposer  disposer    ;   ///< disposer used
-        typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ;    ///< node traits
-
-        typedef cds::urcu::gc< RCU >            gc          ;   ///< Garbage collector
-        typedef typename options::item_counter  item_counter;   ///< Item counting policy used
-        typedef typename options::memory_model  memory_model;   ///< Memory ordering. See cds::opt::memory_model option
-        typedef typename options::random_level_generator    random_level_generator  ;   ///< random level generator
-        typedef typename options::allocator     allocator_type  ;   ///< allocator for maintaining array of next pointers of the node
-        typedef typename options::back_off      back_off    ;   ///< Back-off trategy
-        typedef typename options::stat          stat        ;   ///< internal statistics type
-        typedef typename options::rcu_check_deadlock    rcu_check_deadlock ; ///< Deadlock checking policy
-        typedef typename gc::scoped_lock        rcu_lock    ;   ///< RCU scoped lock
+        typedef typename traits::disposer  disposer;   ///< disposer
+        typedef typename get_node_traits< value_type, node_type, hook>::type node_traits;    ///< node traits
+
+        typedef typename traits::item_counter  item_counter;   ///< Item counting policy used
+        typedef typename traits::memory_model  memory_model;   ///< Memory ordering, see \p cds::opt::memory_model option
+        typedef typename traits::random_level_generator    random_level_generator;   ///< random level generator
+        typedef typename traits::allocator     allocator_type; ///< allocator for maintaining array of next pointers of the node
+        typedef typename traits::back_off      back_off;       ///< Back-off strategy
+        typedef typename traits::stat          stat;           ///< internal statistics type
+        typedef typename traits::rcu_check_deadlock rcu_check_deadlock; ///< Deadlock checking policy
+        typedef typename gc::scoped_lock       rcu_lock;      ///< RCU scoped lock
         static CDS_CONSTEXPR const bool c_bExtractLockExternal = false; ///< Group of \p extract_xxx functions does not require external locking
 
 
@@ -570,9 +543,9 @@ namespace cds { namespace intrusive {
         typedef skip_list::details::intrusive_node_builder< node_type, atomic_node_ptr, allocator_type > intrusive_node_builder;
 
         typedef typename std::conditional<
-            std::is_same< typename options::internal_node_builder, cds::opt::none >::value
+            std::is_same< typename traits::internal_node_builder, cds::opt::none >::value
             ,intrusive_node_builder
-            ,typename options::internal_node_builder
+            ,typename traits::internal_node_builder
         >::type node_builder;
 
         typedef std::unique_ptr< node_type, typename node_builder::node_disposer >    scoped_node_ptr;
@@ -600,13 +573,13 @@ namespace cds { namespace intrusive {
         //@endcond
 
     protected:
-        skip_list::details::head_node< node_type >      m_Head  ;   ///< head tower (max height)
+        skip_list::details::head_node< node_type > m_Head;   ///< head tower (max height)
 
-        item_counter                m_ItemCounter       ;   ///< item counter
-        random_level_generator      m_RandomLevelGen    ;   ///< random level generator instance
-        atomics::atomic<unsigned int>    m_nHeight   ;   ///< estimated high level
+        item_counter                m_ItemCounter;      ///< item counter
+        random_level_generator      m_RandomLevelGen;   ///< random level generator instance
+        atomics::atomic<unsigned int>    m_nHeight;     ///< estimated high level
         atomics::atomic<node_type *>     m_pDeferredDelChain ;   ///< Deferred deleted node chain
-        mutable stat                m_Stat              ;   ///< internal statistics
+        mutable stat                m_Stat;             ///< internal statistics
 
     protected:
         //@cond
@@ -641,7 +614,7 @@ namespace cds { namespace intrusive {
         //@endcond
 
     public:
-        typedef cds::urcu::exempt_ptr< gc, value_type, value_type, node_disposer, void > exempt_ptr ; ///< pointer to extracted node
+        typedef cds::urcu::exempt_ptr< gc, value_type, value_type, node_disposer, void > exempt_ptr; ///< pointer to extracted node
 
     protected:
         //@cond
@@ -1551,13 +1524,13 @@ retry:
             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.
 
-            You can pass \p func argument by value or by reference using \p std::ref.
-
             RCU \p synchronize method can be called. RCU should not be locked.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
             already is in the set.
+
+            @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename Func>
         std::pair<bool, bool> ensure( value_type& val, Func func )
@@ -1620,8 +1593,8 @@ retry:
             The function searches the item \p val in the set and unlink it from the set
             if it is found and is equal to \p val.
 
-            Difference between \ref erase and \p unlink functions: \p erase finds <i>a key</i>
-            and deletes the item found. \p unlink finds an item by key and deletes it
+            Difference between \p erase() and \p %unlink() functions: \p erase() finds <i>a key</i>
+            and deletes the item found. \p %unlink() searches an item by key and deletes it
             only if \p val is an item of that set, i.e. the pointer to item found
             is equal to <tt> &val </tt>.
 
@@ -1791,18 +1764,18 @@ retry:
 
         /// Deletes the item from the set
         /** \anchor cds_intrusive_SkipListSet_rcu_erase
-            The function searches an item with key equal to \p val in the set,
+            The function searches an item with key equal to \p key in the set,
             unlinks it from the set, and returns \p true.
-            If the item with key equal to \p val is not found the function return \p false.
+            If the item with key equal to \p key is not found the function return \p false.
 
             Note the hash functor should accept a parameter of type \p Q that can be not the same as \p value_type.
 
             RCU \p synchronize method can be called. RCU should not be locked.
         */
         template <typename Q>
-        bool erase( const Q& val )
+        bool erase( const Q& key )
         {
-            return do_erase( val, key_comparator(), [](value_type const&) {} );
+            return do_erase( key, key_comparator(), [](value_type const&) {} );
         }
 
         /// Delete the item from the set with comparing functor \p pred
@@ -1813,14 +1786,14 @@ retry:
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool erase_with( const Q& val, Less pred )
+        bool erase_with( const Q& key, Less pred )
         {
-            return do_erase( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type const&) {} );
+            return do_erase( key, cds::opt::details::make_comparator_from_less<Less>(), [](value_type const&) {} );
         }
 
         /// Deletes the item from the set
         /** \anchor cds_intrusive_SkipListSet_rcu_erase_func
-            The function searches an item with key equal to \p val in the set,
+            The function searches an item with key equal to \p key in the set,
             call \p f functor with item found, unlinks it from the set, and returns \p true.
             The \ref disposer specified in \p Traits class template parameter is called
             by garbage collector \p GC asynchronously.
@@ -1831,18 +1804,16 @@ retry:
                 void operator()( value_type const& item );
             };
             \endcode
-            The functor can be passed by reference with <tt>boost:ref</tt>
-
-            If the item with key equal to \p val is not found the function return \p false.
+            If the item with key equal to \p key is not found the function return \p false.
 
             Note the hash functor should accept a parameter of type \p Q that can be not the same as \p value_type.
 
             RCU \p synchronize method can be called. RCU should not be locked.
         */
         template <typename Q, typename Func>
-        bool erase( Q const& val, Func f )
+        bool erase( Q const& key, Func f )
         {
-            return do_erase( val, key_comparator(), f );
+            return do_erase( key, key_comparator(), f );
         }
 
         /// Delete the item from the set with comparing functor \p pred
@@ -1853,21 +1824,21 @@ retry:
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less, typename Func>
-        bool erase_with( Q const& val, Less pred, Func f )
+        bool erase_with( Q const& key, Less pred, Func f )
         {
-            return do_erase( val, cds::opt::details::make_comparator_from_less<Less>(), f );
+            return do_erase( key, cds::opt::details::make_comparator_from_less<Less>(), f );
         }
 
-        /// Finds the key \p val
+        /// Finds \p key
         /** @anchor cds_intrusive_SkipListSet_rcu_find_func
-            The function searches the item with key equal to \p val and calls the functor \p f for item found.
+            The function searches the item with key equal to \p key and calls the functor \p f for item found.
             The interface of \p Func functor is:
             \code
             struct functor {
-                void operator()( value_type& item, Q& val );
+                void operator()( value_type& item, Q& key );
             };
             \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
+            where \p item is the item found, \p key is the <tt>find</tt> function argument.
 
             You can pass \p f argument by value or by reference using \p std::ref.
 
@@ -1876,20 +1847,20 @@ retry:
             The functor does not serialize simultaneous access to the set \p item. If such access is
             possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
 
-            The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
+            The \p key argument is non-const since it can be used as \p f functor destination i.e., the functor
             can modify both arguments.
 
             The function applies RCU lock internally.
 
-            The function returns \p true if \p val is found, \p false otherwise.
+            The function returns \p true if \p key is found, \p false otherwise.
         */
         template <typename Q, typename Func>
-        bool find( Q& val, Func f )
+        bool find( Q& key, Func f )
         {
-            return do_find_with( val, key_comparator(), f );
+            return do_find_with( key, key_comparator(), f );
         }
 
-        /// Finds the key \p val with comparing functor \p pred
+        /// Finds the key \p key with comparing functor \p pred
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_rcu_find_func "find(Q&, Func)"
             but \p cmp is used for key comparison.
@@ -1897,66 +1868,25 @@ retry:
             \p cmp must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less, typename Func>
-        bool find_with( Q& val, Less pred, Func f )
-        {
-            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(), f );
-        }
-
-        /// Finds the key \p val
-        /** @anchor cds_intrusive_SkipListSet_rcu_find_cfunc
-            The function searches the item with key equal to \p val and calls the functor \p f for item found.
-            The interface of \p Func functor is:
-            \code
-            struct functor {
-                void operator()( value_type& item, Q const& val );
-            };
-            \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
-            You can pass \p f argument by value or by reference using \p std::ref.
-
-            The functor can change non-key fields of \p item. Note that the functor is only guarantee
-            that \p item cannot be disposed during functor is executing.
-            The functor does not serialize simultaneous access to the set \p item. If such access is
-            possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
-
-            The function applies RCU lock internally.
-
-            The function returns \p true if \p val is found, \p false otherwise.
-        */
-        template <typename Q, typename Func>
-        bool find( Q const& val, Func f )
-        {
-            return do_find_with( val, key_comparator(), f );
-        }
-
-        /// Finds the key \p val with comparing functor \p pred
-        /**
-            The function is an analog of \ref cds_intrusive_SkipListSet_rcu_find_cfunc "find(Q const&, Func)"
-            but \p cmp is used for key comparison.
-            \p Less functor has the interface like \p std::less.
-            \p cmp must imply the same element order as the comparator used for building the set.
-        */
-        template <typename Q, typename Less, typename Func>
-        bool find_with( Q const& val, Less pred, Func f )
+        bool find_with( Q& key, Less pred, Func f )
         {
-            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(), f );
+            return do_find_with( key, cds::opt::details::make_comparator_from_less<Less>(), f );
         }
 
-        /// Finds the key \p val
+        /// Finds \p key
         /** @anchor cds_intrusive_SkipListSet_rcu_find_val
-            The function searches the item with key equal to \p val
+            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 Q>
-        bool find( Q const& val )
+        bool find( Q const& key )
         {
-            return do_find_with( val, key_comparator(), [](value_type& , Q const& ) {} );
+            return do_find_with( key, key_comparator(), [](value_type& , Q const& ) {} );
         }
 
-        /// Finds the key \p val with comparing functor \p pred
+        /// Finds \p key with comparing functor \p pred
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_rcu_find_val "find(Q const&)"
             but \p pred is used for key compare.
@@ -1964,15 +1894,15 @@ retry:
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        bool find_with( Q const& val, Less pred )
+        bool find_with( Q const& key, Less pred )
         {
-            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
+            return do_find_with( key, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
         }
 
-        /// Finds the key \p val and return the item found
+        /// Finds \p key and return the item found
         /** \anchor cds_intrusive_SkipListSet_rcu_get
-            The function searches the item with key equal to \p val and returns the pointer to item found.
-            If \p val is not found it returns \p nullptr.
+            The function searches the item with key equal to \p key and returns the pointer to item found.
+            If \p key is not found it returns \p nullptr.
 
             Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type.
 
@@ -2000,16 +1930,16 @@ retry:
             see \ref force_dispose for explanation.
         */
         template <typename Q>
-        value_type * get( Q const& val )
+        value_type * get( Q const& key )
         {
             assert( gc::is_locked());
 
             value_type * pFound;
-            return do_find_with( val, key_comparator(), [&pFound](value_type& found, Q const& ) { pFound = &found; } )
+            return do_find_with( key, key_comparator(), [&pFound](value_type& found, Q const& ) { pFound = &found; } )
                 ? pFound : nullptr;
         }
 
-        /// Finds the key \p val and return the item found
+        /// Finds \p key and return the item found
         /**
             The function is an analog of \ref cds_intrusive_SkipListSet_rcu_get "get(Q const&)"
             but \p pred is used for comparing the keys.
@@ -2019,12 +1949,12 @@ retry:
             \p pred must imply the same element order as the comparator used for building the set.
         */
         template <typename Q, typename Less>
-        value_type * get_with( Q const& val, Less pred )
+        value_type * get_with( Q const& key, Less pred )
         {
             assert( gc::is_locked());
 
             value_type * pFound;
-            return do_find_with( val, cds::opt::details::make_comparator_from_less<Less>(),
+            return do_find_with( key, cds::opt::details::make_comparator_from_less<Less>(),
                 [&pFound](value_type& found, Q const& ) { pFound = &found; } )
                 ? pFound : nullptr;
         }
@@ -2032,8 +1962,8 @@ retry:
         /// Returns item count in the set
         /**
             The value returned depends on item counter type provided by \p Traits template parameter.
-            If it is atomicity::empty_item_counter this function always returns 0.
-            Therefore, the function is not suitable for checking the set emptiness, use \ref empty
+            For \p atomicity::empty_item_counter the function always returns 0.
+            Therefore, the function is not suitable for checking the set emptiness, use \p empty()
             member function for this purpose.
         */
         size_t size() const
@@ -2047,7 +1977,7 @@ retry:
             return m_Head.head()->next( 0 ).load( memory_model::memory_order_relaxed ) == nullptr;
         }
 
-        /// Clears the set (non-atomic)
+        /// Clears the set (noatomic)
         /**
             The function unlink all items from the set.
             The function is not atomic, thus, in multi-threaded environment with parallel insertions
@@ -2058,7 +1988,7 @@ retry:
             \endcode
             the assertion could be raised.
 
-            For each item the \ref disposer will be called automatically after unlinking.
+            For each item the \p disposer will be called automatically after unlinking.
         */
         void clear()
         {
index 342715c1cd8a87327c5aeec27284b517783cd6ec..5ed54a007327402613fe4d5b49614c4c849eac61 100644 (file)
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_rcu_shb_lazy.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_rcu_sht.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_rcu_sht_lazy.cpp" />\r
+    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_dhp_member.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_hp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_hp_member.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_nogc.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_nogc_member.cpp" />\r
-    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_ptb.cpp" />\r
-    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_ptb_member.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_rcu_gpb.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_rcu_gpb_member.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_rcu_gpi.cpp" />\r
index 36b3542f59480f903573219ea377997da4bbc6a3..70d1633caab8c7ffa4aae788fbc9521b0d4ee3b4 100644 (file)
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_hp_member.cpp">\r
       <Filter>intrusive\skip_list</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_ptb.cpp">\r
-      <Filter>intrusive\skip_list</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_ptb_member.cpp">\r
-      <Filter>intrusive\skip_list</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_splitlist_set_hp.cpp">\r
       <Filter>intrusive\split_list</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_splitlist_set_rcu_gpt.cpp">\r
       <Filter>container\split_list</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_dhp.cpp">\r
+      <Filter>intrusive\skip_list</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_dhp_member.cpp">\r
+      <Filter>intrusive\skip_list</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_dhp.cpp b/tests/test-hdr/set/hdr_intrusive_skiplist_dhp.cpp
new file mode 100644 (file)
index 0000000..094db5f
--- /dev/null
@@ -0,0 +1,327 @@
+//$$CDS-header$$
+
+#include "set/hdr_intrusive_skiplist_set.h"
+
+#include <cds/intrusive/skip_list_dhp.h>
+#include "map/print_skiplist_stat.h"
+
+namespace set {
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmp()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_less()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmpmix()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,co::compare< cmp<item> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmp_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_less_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::stat< ci::skip_list::stat<> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmpmix_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmp_xorshift()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_less_xorshift()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmpmix_xorshift()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+        void IntrusiveSkipListSet::skiplist_dhp_base_cmp_xorshift_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::stat< ci::skip_list::stat<> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_less_xorshift_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::stat< ci::skip_list::stat<> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmpmix_xorshift_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::stat< ci::skip_list::stat<> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+
+    //*********
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmp_pascal()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_less_pascal()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmpmix_pascal()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+        void IntrusiveSkipListSet::skiplist_dhp_base_cmp_pascal_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_less_pascal_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_base_cmpmix_pascal_stat()
+    {
+        typedef base_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+}   // namespace set
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_dhp_member.cpp b/tests/test-hdr/set/hdr_intrusive_skiplist_dhp_member.cpp
new file mode 100644 (file)
index 0000000..fa04e38
--- /dev/null
@@ -0,0 +1,325 @@
+//$$CDS-header$$
+
+#include "set/hdr_intrusive_skiplist_set.h"
+
+#include <cds/intrusive/skip_list_dhp.h>
+#include "map/print_skiplist_stat.h"
+
+namespace set {
+        void IntrusiveSkipListSet::skiplist_dhp_member_cmp()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_less()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmpmix()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmp_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_less_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmpmix_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmp_xorshift()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_less_xorshift()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmpmix_xorshift()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+        void IntrusiveSkipListSet::skiplist_dhp_member_cmp_xorshift_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::stat< ci::skip_list::stat<> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_less_xorshift_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmpmix_xorshift_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
+                ,co::stat< ci::skip_list::stat<> >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmp_pascal()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_less_pascal()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmpmix_pascal()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,co::item_counter< cds::atomicity::item_counter >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+        void IntrusiveSkipListSet::skiplist_dhp_member_cmp_pascal_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_less_pascal_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+    void IntrusiveSkipListSet::skiplist_dhp_member_cmpmix_pascal_stat()
+    {
+        typedef member_int_item< ci::skip_list::node< cds::gc::DHP> > item;
+
+        typedef ci::SkipListSet< cds::gc::DHP, item,
+            ci::skip_list::make_traits<
+                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::DHP> > >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+                ,co::compare< cmp<item> >
+                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
+                ,co::stat< ci::skip_list::stat<> >
+                ,co::item_counter< cds::atomicity::item_counter >
+            >::type
+        >   set_type;
+
+        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
+    }
+
+} // namespace set
index 5919a65f43efde182327106eb81035b93c61edef..4ed25540f01125ca3e9334d287220a44785421a5 100644 (file)
@@ -10,15 +10,14 @@ namespace set {
     void IntrusiveSkipListSet::skiplist_hp_base_cmp()
     {
         typedef base_int_item< ci::skip_list::node< cds::gc::HP> > item;
-
-        typedef ci::SkipListSet< cds::gc::HP, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::HP> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
+        struct set_traits : public ci::skip_list::traits
+        {
+            typedef ci::skip_list::base_hook< co::gc<cds::gc::HP> > hook;
+            typedef cmp<item> compare;
+            typedef faked_disposer disposer;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef ci::SkipListSet< cds::gc::HP, item, set_traits > set_type;
 
         test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
     }
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_ptb.cpp b/tests/test-hdr/set/hdr_intrusive_skiplist_ptb.cpp
deleted file mode 100644 (file)
index 2ea52b9..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-//$$CDS-header$$
-
-#include "set/hdr_intrusive_skiplist_set.h"
-
-#include <cds/intrusive/skip_list_dhp.h>
-#include "map/print_skiplist_stat.h"
-
-namespace set {
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmp()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_less()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmpmix()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,co::compare< cmp<item> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmp_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_less_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::stat< ci::skip_list::stat<> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmpmix_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmp_xorshift()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_less_xorshift()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmpmix_xorshift()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-        void IntrusiveSkipListSet::skiplist_ptb_base_cmp_xorshift_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::stat< ci::skip_list::stat<> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_less_xorshift_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::stat< ci::skip_list::stat<> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmpmix_xorshift_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::stat< ci::skip_list::stat<> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-
-    //*********
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmp_pascal()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_less_pascal()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmpmix_pascal()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-        void IntrusiveSkipListSet::skiplist_ptb_base_cmp_pascal_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_less_pascal_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_base_cmpmix_pascal_stat()
-    {
-        typedef base_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::base_hook< co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-}   // namespace set
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_ptb_member.cpp b/tests/test-hdr/set/hdr_intrusive_skiplist_ptb_member.cpp
deleted file mode 100644 (file)
index f628dfb..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-//$$CDS-header$$
-
-#include "set/hdr_intrusive_skiplist_set.h"
-
-#include <cds/intrusive/skip_list_dhp.h>
-#include "map/print_skiplist_stat.h"
-
-namespace set {
-        void IntrusiveSkipListSet::skiplist_ptb_member_cmp()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_less()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmpmix()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmp_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_less_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmpmix_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmp_xorshift()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_less_xorshift()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmpmix_xorshift()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-        void IntrusiveSkipListSet::skiplist_ptb_member_cmp_xorshift_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::stat< ci::skip_list::stat<> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_less_xorshift_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmpmix_xorshift_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::xorshift >
-                ,co::stat< ci::skip_list::stat<> >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmp_pascal()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_less_pascal()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmpmix_pascal()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,co::item_counter< cds::atomicity::item_counter >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-        void IntrusiveSkipListSet::skiplist_ptb_member_cmp_pascal_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::compare< cmp<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_less_pascal_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-    void IntrusiveSkipListSet::skiplist_ptb_member_cmpmix_pascal_stat()
-    {
-        typedef member_int_item< ci::skip_list::node< cds::gc::PTB> > item;
-
-        typedef ci::SkipListSet< cds::gc::PTB, item,
-            ci::skip_list::make_traits<
-                ci::opt::hook< ci::skip_list::member_hook< offsetof(item, hMember), co::gc<cds::gc::PTB> > >
-                ,co::less< less<item> >
-                ,ci::opt::disposer< faked_disposer >
-                ,co::compare< cmp<item> >
-                ,ci::skip_list::random_level_generator< ci::skip_list::turbo_pascal >
-                ,co::stat< ci::skip_list::stat<> >
-                ,co::item_counter< cds::atomicity::item_counter >
-            >::type
-        >   set_type;
-
-        test_skiplist<set_type, misc::print_skiplist_stat<set_type::stat> >();
-    }
-
-} // namespace set
index 9490b82b0ae6b5fe6db91c6bc44a0b63ea90b86b..342b456dfcfe8ebac03525cf45be69bbdd1b2353 100644 (file)
@@ -550,44 +550,44 @@ namespace set {
         void skiplist_hp_member_less_pascal_stat();
         void skiplist_hp_member_cmpmix_pascal_stat();
 
-        // Skip-list - gc::PTB
-        void skiplist_ptb_base_cmp();
-        void skiplist_ptb_base_less();
-        void skiplist_ptb_base_cmpmix();
-        void skiplist_ptb_base_cmp_stat();
-        void skiplist_ptb_base_less_stat();
-        void skiplist_ptb_base_cmpmix_stat();
-        void skiplist_ptb_base_cmp_xorshift();
-        void skiplist_ptb_base_less_xorshift();
-        void skiplist_ptb_base_cmpmix_xorshift();
-        void skiplist_ptb_base_cmp_xorshift_stat();
-        void skiplist_ptb_base_less_xorshift_stat();
-        void skiplist_ptb_base_cmpmix_xorshift_stat();
-        void skiplist_ptb_base_cmp_pascal();
-        void skiplist_ptb_base_less_pascal();
-        void skiplist_ptb_base_cmpmix_pascal();
-        void skiplist_ptb_base_cmp_pascal_stat();
-        void skiplist_ptb_base_less_pascal_stat();
-        void skiplist_ptb_base_cmpmix_pascal_stat();
-
-        void skiplist_ptb_member_cmp();
-        void skiplist_ptb_member_less();
-        void skiplist_ptb_member_cmpmix();
-        void skiplist_ptb_member_cmp_stat();
-        void skiplist_ptb_member_less_stat();
-        void skiplist_ptb_member_cmpmix_stat();
-        void skiplist_ptb_member_cmp_xorshift();
-        void skiplist_ptb_member_less_xorshift();
-        void skiplist_ptb_member_cmpmix_xorshift();
-        void skiplist_ptb_member_cmp_xorshift_stat();
-        void skiplist_ptb_member_less_xorshift_stat();
-        void skiplist_ptb_member_cmpmix_xorshift_stat();
-        void skiplist_ptb_member_cmp_pascal();
-        void skiplist_ptb_member_less_pascal();
-        void skiplist_ptb_member_cmpmix_pascal();
-        void skiplist_ptb_member_cmp_pascal_stat();
-        void skiplist_ptb_member_less_pascal_stat();
-        void skiplist_ptb_member_cmpmix_pascal_stat();
+        // Skip-list - gc::DHP
+        void skiplist_dhp_base_cmp();
+        void skiplist_dhp_base_less();
+        void skiplist_dhp_base_cmpmix();
+        void skiplist_dhp_base_cmp_stat();
+        void skiplist_dhp_base_less_stat();
+        void skiplist_dhp_base_cmpmix_stat();
+        void skiplist_dhp_base_cmp_xorshift();
+        void skiplist_dhp_base_less_xorshift();
+        void skiplist_dhp_base_cmpmix_xorshift();
+        void skiplist_dhp_base_cmp_xorshift_stat();
+        void skiplist_dhp_base_less_xorshift_stat();
+        void skiplist_dhp_base_cmpmix_xorshift_stat();
+        void skiplist_dhp_base_cmp_pascal();
+        void skiplist_dhp_base_less_pascal();
+        void skiplist_dhp_base_cmpmix_pascal();
+        void skiplist_dhp_base_cmp_pascal_stat();
+        void skiplist_dhp_base_less_pascal_stat();
+        void skiplist_dhp_base_cmpmix_pascal_stat();
+
+        void skiplist_dhp_member_cmp();
+        void skiplist_dhp_member_less();
+        void skiplist_dhp_member_cmpmix();
+        void skiplist_dhp_member_cmp_stat();
+        void skiplist_dhp_member_less_stat();
+        void skiplist_dhp_member_cmpmix_stat();
+        void skiplist_dhp_member_cmp_xorshift();
+        void skiplist_dhp_member_less_xorshift();
+        void skiplist_dhp_member_cmpmix_xorshift();
+        void skiplist_dhp_member_cmp_xorshift_stat();
+        void skiplist_dhp_member_less_xorshift_stat();
+        void skiplist_dhp_member_cmpmix_xorshift_stat();
+        void skiplist_dhp_member_cmp_pascal();
+        void skiplist_dhp_member_less_pascal();
+        void skiplist_dhp_member_cmpmix_pascal();
+        void skiplist_dhp_member_cmp_pascal_stat();
+        void skiplist_dhp_member_less_pascal_stat();
+        void skiplist_dhp_member_cmpmix_pascal_stat();
 
         // Skip-list - gc::nogc
         void skiplist_nogc_base_cmp();
@@ -667,43 +667,43 @@ namespace set {
             CPPUNIT_TEST(skiplist_hp_member_less_pascal_stat)
             CPPUNIT_TEST(skiplist_hp_member_cmpmix_pascal_stat)
 
-            CPPUNIT_TEST(skiplist_ptb_base_cmp)
-            CPPUNIT_TEST(skiplist_ptb_base_less)
-            CPPUNIT_TEST(skiplist_ptb_base_cmpmix)
-            CPPUNIT_TEST(skiplist_ptb_base_cmp_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_less_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_cmpmix_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_cmp_xorshift)
-            CPPUNIT_TEST(skiplist_ptb_base_less_xorshift)
-            CPPUNIT_TEST(skiplist_ptb_base_cmpmix_xorshift)
-            CPPUNIT_TEST(skiplist_ptb_base_cmp_xorshift_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_less_xorshift_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_cmpmix_xorshift_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_cmp_pascal)
-            CPPUNIT_TEST(skiplist_ptb_base_less_pascal)
-            CPPUNIT_TEST(skiplist_ptb_base_cmpmix_pascal)
-            CPPUNIT_TEST(skiplist_ptb_base_cmp_pascal_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_less_pascal_stat)
-            CPPUNIT_TEST(skiplist_ptb_base_cmpmix_pascal_stat)
-
-            CPPUNIT_TEST(skiplist_ptb_member_cmp)
-            CPPUNIT_TEST(skiplist_ptb_member_less)
-            CPPUNIT_TEST(skiplist_ptb_member_cmpmix)
-            CPPUNIT_TEST(skiplist_ptb_member_cmp_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_less_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_cmpmix_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_cmp_xorshift)
-            CPPUNIT_TEST(skiplist_ptb_member_less_xorshift)
-            CPPUNIT_TEST(skiplist_ptb_member_cmpmix_xorshift)
-            CPPUNIT_TEST(skiplist_ptb_member_cmp_xorshift_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_less_xorshift_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_cmpmix_xorshift_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_cmp_pascal)
-            CPPUNIT_TEST(skiplist_ptb_member_less_pascal)
-            CPPUNIT_TEST(skiplist_ptb_member_cmpmix_pascal)
-            CPPUNIT_TEST(skiplist_ptb_member_cmp_pascal_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_less_pascal_stat)
-            CPPUNIT_TEST(skiplist_ptb_member_cmpmix_pascal_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_cmp)
+            CPPUNIT_TEST(skiplist_dhp_base_less)
+            CPPUNIT_TEST(skiplist_dhp_base_cmpmix)
+            CPPUNIT_TEST(skiplist_dhp_base_cmp_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_less_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_cmpmix_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_cmp_xorshift)
+            CPPUNIT_TEST(skiplist_dhp_base_less_xorshift)
+            CPPUNIT_TEST(skiplist_dhp_base_cmpmix_xorshift)
+            CPPUNIT_TEST(skiplist_dhp_base_cmp_xorshift_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_less_xorshift_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_cmpmix_xorshift_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_cmp_pascal)
+            CPPUNIT_TEST(skiplist_dhp_base_less_pascal)
+            CPPUNIT_TEST(skiplist_dhp_base_cmpmix_pascal)
+            CPPUNIT_TEST(skiplist_dhp_base_cmp_pascal_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_less_pascal_stat)
+            CPPUNIT_TEST(skiplist_dhp_base_cmpmix_pascal_stat)
+
+            CPPUNIT_TEST(skiplist_dhp_member_cmp)
+            CPPUNIT_TEST(skiplist_dhp_member_less)
+            CPPUNIT_TEST(skiplist_dhp_member_cmpmix)
+            CPPUNIT_TEST(skiplist_dhp_member_cmp_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_less_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_cmpmix_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_cmp_xorshift)
+            CPPUNIT_TEST(skiplist_dhp_member_less_xorshift)
+            CPPUNIT_TEST(skiplist_dhp_member_cmpmix_xorshift)
+            CPPUNIT_TEST(skiplist_dhp_member_cmp_xorshift_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_less_xorshift_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_cmpmix_xorshift_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_cmp_pascal)
+            CPPUNIT_TEST(skiplist_dhp_member_less_pascal)
+            CPPUNIT_TEST(skiplist_dhp_member_cmpmix_pascal)
+            CPPUNIT_TEST(skiplist_dhp_member_cmp_pascal_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_less_pascal_stat)
+            CPPUNIT_TEST(skiplist_dhp_member_cmpmix_pascal_stat)
 
             CPPUNIT_TEST(skiplist_nogc_base_cmp)
             CPPUNIT_TEST(skiplist_nogc_base_less)