@ingroup cds_nonintrusive_containers
*/
+
+ // Tag for selecting iterable list implementation
+ /** @ingroup cds_nonintrusive_helper
+ This struct is empty and it is used only as a tag for selecting \p IterableList
+ as ordered list implementation in declaration of some classes.
+
+ See \p split_list::traits::ordered_list as an example.
+ */
+ typedef intrusive::iterable_list_tag iterable_list_tag;
+
//@cond
template <typename List>
struct is_iterable_list: public cds::intrusive::is_iterable_list< List >
template <typename GC, typename Key, typename Value, typename Traits=iterable_list::traits>
class IterableKVList;
- // Tag for selecting iterable list implementation
- /**
- This struct is empty and it is used only as a tag for selecting \p IterableList
- as ordered list implementation in declaration of some classes.
-
- See \p split_list::traits::ordered_list as an example.
- */
- struct iterable_list_tag
- {};
-
- //@cond
- template <typename GC, typename T, typename Traits>
- struct is_iterable_list< IterableList<GC, T, Traits >>
- {
- enum {
- value = true
- };
- };
-
- template <typename GC, typename K, typename V, typename Traits>
- struct is_iterable_list< IterableKVList<GC, K, V, Traits >>
- {
- enum {
- value = true
- };
- };
- //@endcond
-
}} // namespace cds::container
struct michael_list_tag;
struct lazy_list_tag;
- namespace details {
+}} // namespace cds::container
-#ifdef CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
- // if michael_list included
-
- template <typename GC, typename T, typename Traits>
- struct make_split_list_set< GC, T, michael_list_tag, Traits >
- {
- typedef GC gc;
- typedef T value_type;
- typedef Traits original_traits;
-
- typedef typename cds::opt::select_default<
- typename original_traits::ordered_list_traits,
- cds::container::michael_list::traits
- >::type original_ordered_list_traits;
-
- typedef cds::intrusive::split_list::node< cds::intrusive::michael_list::node<gc> > primary_node_type;
- struct node_type: public primary_node_type
- {
- value_type m_Value;
-
- template <typename Q>
- explicit node_type( Q const& v )
- : m_Value(v)
- {}
- template <typename Q, typename... Args>
- explicit node_type( Q&& q, Args&&... args )
- : m_Value( std::forward<Q>(q), std::forward<Args>(args)... )
- {}
-
- node_type() = delete;
- };
-
- typedef typename cds::opt::select_default<
- typename original_traits::ordered_list_traits,
- typename original_traits::allocator,
- typename cds::opt::select_default<
- typename original_traits::ordered_list_traits::allocator,
- typename original_traits::allocator
- >::type
- >::type node_allocator_;
-
- typedef typename node_allocator_::template rebind<node_type>::other node_allocator_type;
-
- typedef cds::details::Allocator< node_type, node_allocator_type > cxx_node_allocator;
- struct node_deallocator
- {
- void operator ()( node_type * pNode )
- {
- cxx_node_allocator().Delete( pNode );
- }
- };
- typedef typename opt::details::make_comparator< value_type, original_ordered_list_traits >::type key_comparator;
-
- typedef typename original_traits::key_accessor key_accessor;
-
- struct value_accessor
- {
- typename key_accessor::key_type const& operator()( node_type const& node ) const
- {
- return key_accessor()(node.m_Value);
- }
- };
-
- template <typename Predicate>
- struct predicate_wrapper {
- typedef cds::details::predicate_wrapper< node_type, Predicate, value_accessor > type;
- };
-
- struct ordered_list_traits: public original_ordered_list_traits
- {
- typedef cds::intrusive::michael_list::base_hook<
- opt::gc<gc>
- > hook;
- typedef cds::atomicity::empty_item_counter item_counter;
- typedef node_deallocator disposer;
- typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
- static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::michael_list::traits::link_checker;
- };
-
- struct traits: public original_traits
- {
- struct hash: public original_traits::hash
- {
- typedef typename original_traits::hash base_class;
-
- size_t operator()(node_type const& v ) const
- {
- return base_class::operator()( key_accessor()( v.m_Value ) );
- }
- template <typename Q>
- size_t operator()( Q const& k ) const
- {
- return base_class::operator()( k );
- }
- };
- };
-
- class ordered_list: public cds::intrusive::MichaelList< gc, node_type, ordered_list_traits >
- {};
- //typedef cds::intrusive::MichaelList< gc, node_type, ordered_list_traits > ordered_list;
- typedef cds::intrusive::SplitListSet< gc, ordered_list, traits > type;
- };
-#endif // ifdef CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
+#ifdef CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
+# include <cds/container/details/make_split_list_set_michael_list.h>
+#endif
#ifdef CDSLIB_CONTAINER_DETAILS_LAZY_LIST_BASE_H
- // if lazy_list included
- template <typename GC, typename T, typename Traits>
- struct make_split_list_set< GC, T, lazy_list_tag, Traits >
- {
- typedef GC gc;
- typedef T value_type;
- typedef Traits original_traits;
-
- typedef typename cds::opt::select_default<
- typename original_traits::ordered_list_traits,
- cds::container::lazy_list::traits
- >::type original_ordered_list_traits;
-
- typedef typename cds::opt::select_default<
- typename original_ordered_list_traits::lock_type,
- typename cds::container::lazy_list::traits::lock_type
- >::type lock_type;
-
- typedef cds::intrusive::split_list::node< cds::intrusive::lazy_list::node<gc, lock_type > > primary_node_type;
- struct node_type: public primary_node_type
- {
- value_type m_Value;
-
- template <typename Q>
- explicit node_type( const Q& v )
- : m_Value(v)
- {}
-
- template <typename Q, typename... Args>
- explicit node_type( Q&& q, Args&&... args )
- : m_Value( std::forward<Q>(q), std::forward<Args>(args)... )
- {}
-
- node_type() = delete;
- };
-
- typedef typename cds::opt::select_default<
- typename original_traits::ordered_list_traits,
- typename original_traits::allocator,
- typename cds::opt::select_default<
- typename original_traits::ordered_list_traits::allocator,
- typename original_traits::allocator
- >::type
- >::type node_allocator_;
-
- typedef typename node_allocator_::template rebind<node_type>::other node_allocator_type;
-
- typedef cds::details::Allocator< node_type, node_allocator_type > cxx_node_allocator;
- struct node_deallocator
- {
- void operator ()( node_type * pNode )
- {
- cxx_node_allocator().Delete( pNode );
- }
- };
-
- typedef typename opt::details::make_comparator< value_type, original_ordered_list_traits >::type key_comparator;
-
- typedef typename original_traits::key_accessor key_accessor;
-
- struct value_accessor
- {
- typename key_accessor::key_type const & operator()( node_type const & node ) const
- {
- return key_accessor()(node.m_Value);
- }
- };
-
- template <typename Predicate>
- struct predicate_wrapper {
- typedef cds::details::predicate_wrapper< node_type, Predicate, value_accessor > type;
- };
-
- struct ordered_list_traits: public original_ordered_list_traits
- {
- typedef cds::intrusive::lazy_list::base_hook<
- opt::gc<gc>
- ,opt::lock_type< lock_type >
- > hook;
- typedef cds::atomicity::empty_item_counter item_counter;
- typedef node_deallocator disposer;
- typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
- static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::lazy_list::traits::link_checker;
- };
-
- struct traits: public original_traits
- {
- struct hash: public original_traits::hash
- {
- typedef typename original_traits::hash base_class;
-
- size_t operator()(node_type const& v ) const
- {
- return base_class::operator()( key_accessor()( v.m_Value ));
- }
- template <typename Q>
- size_t operator()( Q const& k ) const
- {
- return base_class::operator()( k );
- }
- };
- };
-
- class ordered_list: public cds::intrusive::LazyList< gc, node_type, ordered_list_traits >
- {};
- //typedef cds::intrusive::LazyList< gc, node_type, ordered_list_traits > ordered_list;
- typedef cds::intrusive::SplitListSet< gc, ordered_list, traits > type;
- };
-#endif // ifdef CDSLIB_CONTAINER_DETAILS_LAZY_LIST_BASE_H
+# include <cds/container/details/make_split_list_set_lazy_list.h>
+#endif
- } // namespace details
-}} // namespace cds::container
-//@endcond
+#ifdef CDSLIB_CONTAINER_DETAILS_ITERABLE_LIST_BASE_H
+# include <cds/container/details/make_split_list_set_iterable_list.h>
+#endif
#endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_LAZY_LIST_H
+#define CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_LAZY_LIST_H
+
+//@cond
+namespace cds { namespace container { namespace details {
+
+ template <typename GC, typename T, typename Traits>
+ struct make_split_list_set< GC, T, lazy_list_tag, Traits >
+ {
+ typedef GC gc;
+ typedef T value_type;
+ typedef Traits original_traits;
+
+ typedef typename cds::opt::select_default<
+ typename original_traits::ordered_list_traits,
+ cds::container::lazy_list::traits
+ >::type original_ordered_list_traits;
+
+ typedef typename cds::opt::select_default<
+ typename original_ordered_list_traits::lock_type,
+ typename cds::container::lazy_list::traits::lock_type
+ >::type lock_type;
+
+ typedef cds::intrusive::split_list::node< cds::intrusive::lazy_list::node<gc, lock_type > > primary_node_type;
+ struct node_type: public primary_node_type
+ {
+ value_type m_Value;
+
+ template <typename Q>
+ explicit node_type( const Q& v )
+ : m_Value(v)
+ {}
+
+ template <typename Q, typename... Args>
+ explicit node_type( Q&& q, Args&&... args )
+ : m_Value( std::forward<Q>(q), std::forward<Args>(args)... )
+ {}
+
+ node_type() = delete;
+ };
+
+ typedef typename cds::opt::select_default<
+ typename original_traits::ordered_list_traits,
+ typename original_traits::allocator,
+ typename cds::opt::select_default<
+ typename original_traits::ordered_list_traits::allocator,
+ typename original_traits::allocator
+ >::type
+ >::type node_allocator_;
+
+ typedef typename node_allocator_::template rebind<node_type>::other node_allocator_type;
+
+ typedef cds::details::Allocator< node_type, node_allocator_type > cxx_node_allocator;
+ struct node_deallocator
+ {
+ void operator ()( node_type * pNode )
+ {
+ cxx_node_allocator().Delete( pNode );
+ }
+ };
+
+ typedef typename opt::details::make_comparator< value_type, original_ordered_list_traits >::type key_comparator;
+
+ typedef typename original_traits::key_accessor key_accessor;
+
+ struct value_accessor
+ {
+ typename key_accessor::key_type const & operator()( node_type const & node ) const
+ {
+ return key_accessor()(node.m_Value);
+ }
+ };
+
+ template <typename Predicate>
+ struct predicate_wrapper {
+ typedef cds::details::predicate_wrapper< node_type, Predicate, value_accessor > type;
+ };
+
+ struct ordered_list_traits: public original_ordered_list_traits
+ {
+ typedef cds::intrusive::lazy_list::base_hook<
+ opt::gc<gc>
+ ,opt::lock_type< lock_type >
+ > hook;
+ typedef cds::atomicity::empty_item_counter item_counter;
+ typedef node_deallocator disposer;
+ typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
+ static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::lazy_list::traits::link_checker;
+ };
+
+ struct traits: public original_traits
+ {
+ struct hash: public original_traits::hash
+ {
+ typedef typename original_traits::hash base_class;
+
+ size_t operator()(node_type const& v ) const
+ {
+ return base_class::operator()( key_accessor()( v.m_Value ));
+ }
+ template <typename Q>
+ size_t operator()( Q const& k ) const
+ {
+ return base_class::operator()( k );
+ }
+ };
+ };
+
+ class ordered_list: public cds::intrusive::LazyList< gc, node_type, ordered_list_traits >
+ {};
+
+ typedef cds::intrusive::SplitListSet< gc, ordered_list, traits > type;
+ };
+}}} // namespace cds::container::details
+//@endcond
+
+#endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_LAZY_LIST_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_MICHAEL_LIST_H
+#define CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_MICHAEL_LIST_H
+
+//@cond
+namespace cds { namespace container { namespace details {
+
+ template <typename GC, typename T, typename Traits>
+ struct make_split_list_set< GC, T, michael_list_tag, Traits >
+ {
+ typedef GC gc;
+ typedef T value_type;
+ typedef Traits original_traits;
+
+ typedef typename cds::opt::select_default<
+ typename original_traits::ordered_list_traits,
+ cds::container::michael_list::traits
+ >::type original_ordered_list_traits;
+
+ typedef cds::intrusive::split_list::node< cds::intrusive::michael_list::node<gc> > primary_node_type;
+ struct node_type: public primary_node_type
+ {
+ value_type m_Value;
+
+ template <typename Q>
+ explicit node_type( Q const& v )
+ : m_Value(v)
+ {}
+ template <typename Q, typename... Args>
+ explicit node_type( Q&& q, Args&&... args )
+ : m_Value( std::forward<Q>(q), std::forward<Args>(args)... )
+ {}
+
+ node_type() = delete;
+ };
+
+ typedef typename cds::opt::select_default<
+ typename original_traits::ordered_list_traits,
+ typename original_traits::allocator,
+ typename cds::opt::select_default<
+ typename original_traits::ordered_list_traits::allocator,
+ typename original_traits::allocator
+ >::type
+ >::type node_allocator_;
+
+ typedef typename node_allocator_::template rebind<node_type>::other node_allocator_type;
+
+ typedef cds::details::Allocator< node_type, node_allocator_type > cxx_node_allocator;
+ struct node_deallocator
+ {
+ void operator ()( node_type * pNode )
+ {
+ cxx_node_allocator().Delete( pNode );
+ }
+ };
+
+ typedef typename opt::details::make_comparator< value_type, original_ordered_list_traits >::type key_comparator;
+
+ typedef typename original_traits::key_accessor key_accessor;
+
+ struct value_accessor
+ {
+ typename key_accessor::key_type const& operator()( node_type const& node ) const
+ {
+ return key_accessor()(node.m_Value);
+ }
+ };
+
+ template <typename Predicate>
+ struct predicate_wrapper {
+ typedef cds::details::predicate_wrapper< node_type, Predicate, value_accessor > type;
+ };
+
+ struct ordered_list_traits: public original_ordered_list_traits
+ {
+ typedef cds::intrusive::michael_list::base_hook<
+ opt::gc<gc>
+ > hook;
+ typedef cds::atomicity::empty_item_counter item_counter;
+ typedef node_deallocator disposer;
+ typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
+ static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::michael_list::traits::link_checker;
+ };
+
+ struct traits: public original_traits
+ {
+ struct hash: public original_traits::hash
+ {
+ typedef typename original_traits::hash base_class;
+
+ size_t operator()(node_type const& v ) const
+ {
+ return base_class::operator()( key_accessor()( v.m_Value ) );
+ }
+ template <typename Q>
+ size_t operator()( Q const& k ) const
+ {
+ return base_class::operator()( k );
+ }
+ };
+ };
+
+ class ordered_list: public cds::intrusive::MichaelList< gc, node_type, ordered_list_traits >
+ {};
+
+ typedef cds::intrusive::SplitListSet< gc, ordered_list, traits > type;
+ };
+
+}}} // namespace cds::container::details
+//@endcond
+
+#endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_MICHAEL_LIST_H
Supported types are:
- \p michael_list_tag - for \p MichaelList
- \p lazy_list_tag - for \p LazyList
+ - \p iterable_list_tag - for \p IterableList
*/
typedef michael_list_tag ordered_list;
Specifyes traits for selected ordered list type, default type:
- for \p michael_list_tag: \p container::michael_list::traits.
- for \p lazy_list_tag: \p container::lazy_list::traits.
+ - for \p iterable_list_tag: \p container::iterable_list::traits.
If this type is \p opt::none, the ordered list traits is combined with default
ordered list traits and split-list traits.
*/
//@cond
+ class iterable_list_tag
+ {};
+
template <typename List>
- struct is_iterable_list {
- enum {
- value = false
- };
- };
+ struct is_iterable_list: public std::is_base_of< iterable_list_tag, List>
+ {};
//@endcond
}} // namespace cds::intrusuve
class IterableList;
//@endcond
- //@cond
- template <typename GC, typename T, typename Traits>
- struct is_iterable_list< IterableList< GC, T, Traits >> {
- enum {
- value = true
- };
- };
- //@endcond
-
}} // namespace cds::intrusive
#endif // #ifndef CDSLIB_INTRUSIVE_DETAILS_ITERABLE_LIST_BASE_H
#endif
>
class IterableList
+#ifndef CDS_DOXYGEN_INVOKED
+ : public iterable_list_tag
+#endif
{
public:
typedef T value_type; ///< type of value stored in the list
<ClInclude Include="..\..\..\cds\container\details\make_skip_list_map.h" />\r
<ClInclude Include="..\..\..\cds\container\details\make_skip_list_set.h" />\r
<ClInclude Include="..\..\..\cds\container\details\make_split_list_set.h" />\r
+ <ClInclude Include="..\..\..\cds\container\details\make_split_list_set_lazy_list.h" />\r
+ <ClInclude Include="..\..\..\cds\container\details\make_split_list_set_michael_list.h" />\r
<ClInclude Include="..\..\..\cds\container\details\michael_list_base.h" />\r
<ClInclude Include="..\..\..\cds\container\details\michael_map_base.h" />\r
<ClInclude Include="..\..\..\cds\container\details\michael_set_base.h" />\r
<ClInclude Include="..\..\..\cds\intrusive\free_list_cached.h">\r
<Filter>Header Files\cds\intrusive</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\..\cds\container\details\make_split_list_set_lazy_list.h">\r
+ <Filter>Header Files\cds\container\details</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\cds\container\details\make_split_list_set_michael_list.h">\r
+ <Filter>Header Files\cds\container\details</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
test_hp( l );
}
+ TEST_F( IntrusiveIterableList_HP, derived )
+ {
+ class list_type: public ci::IterableList< gc_type, item_type,
+ typename ci::iterable_list::make_traits<
+ ci::opt::disposer< mock_disposer >
+ ,cds::opt::less< less< item_type >>
+ ,cds::opt::item_counter< cds::atomicity::item_counter >
+
+ >::type
+ >
+ {};
+
+ list_type l;
+ test_common( l );
+ test_ordered_iterator( l );
+ test_hp( l );
+ }
+
} // namespace
EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
}
+ TEST_F( IntrusiveMichaelIterableSet_DHP, derived_list )
+ {
+ class bucket_type: public ci::IterableList< gc_type
+ , item_type
+ ,ci::iterable_list::make_traits<
+ ci::opt::compare< cmp<item_type> >
+ ,ci::opt::disposer< mock_disposer >
+ >::type
+ >
+ {};
+
+ typedef ci::MichaelHashSet< gc_type, bucket_type,
+ ci::michael_set::make_traits<
+ ci::opt::hash< hash_int >
+ >::type
+ > set_type;
+
+ set_type s( kSize, 2 );
+ test( s );
+ }
+
} // namespace
EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
}
+ TEST_F( IntrusiveMichaelIterableSet_HP, derived_list )
+ {
+ class bucket_type: public ci::IterableList< gc_type
+ , item_type
+ , ci::iterable_list::make_traits<
+ ci::opt::compare< cmp<item_type> >
+ ,ci::opt::disposer< mock_disposer >
+ >::type
+ >
+ {};
+
+ typedef ci::MichaelHashSet< gc_type, bucket_type,
+ ci::michael_set::make_traits<
+ ci::opt::hash< hash_int >
+ >::type
+ > set_type;
+
+ set_type s( kSize, 2 );
+ test( s );
+ }
+
} // namespace
}
+ TEST_F( IntrusiveSplitListIterableSet_DHP, bucket_type )
+ {
+ class bucket_type: public ci::IterableList< gc_type
+ , item_type
+ ,ci::iterable_list::make_traits<
+ ci::opt::compare< cmp<item_type> >
+ ,ci::opt::disposer< mock_disposer >
+ >::type
+ >
+ {};
+
+ typedef ci::SplitListSet< gc_type, bucket_type,
+ ci::split_list::make_traits<
+ ci::opt::hash< hash_int >
+ >::type
+ > set_type;
+
+ set_type s( kSize, 2 );
+ test( s );
+ }
+
} // namespace
EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
}
+ TEST_F( IntrusiveSplitListIterableSet_HP, derived_list )
+ {
+ class bucket_type: public ci::IterableList< gc_type
+ , item_type
+ ,ci::iterable_list::make_traits<
+ ci::opt::compare< cmp<item_type> >
+ ,ci::opt::disposer< mock_disposer >
+ >::type
+ >
+ {};
+
+ typedef ci::SplitListSet< gc_type, bucket_type,
+ ci::split_list::make_traits<
+ ci::opt::hash< hash_int >
+ >::type
+ > set_type;
+
+ set_type s( kSize, 2 );
+ test( s );
+ }
+
} // namespace