3 #include "set/hdr_intrusive_striped_set.h"
4 #include <cds/intrusive/striped_set/boost_treap_set.h>
5 #include <cds/intrusive/striped_set.h>
8 namespace bi = boost::intrusive;
11 typedef IntrusiveStripedSetHdrTest::base_item< bi::bs_set_base_hook<> > base_item_type;
12 typedef IntrusiveStripedSetHdrTest::member_item< bi::bs_set_member_hook<> > member_item_type;
15 struct priority_cmp: private IntrusiveStripedSetHdrTest::less<T>
17 typedef IntrusiveStripedSetHdrTest::less<T> base_class;
19 template <typename A, typename B>
20 bool operator()( A const& a, B const& b ) const
22 return base_class::operator()( b, a );
27 void IntrusiveStripedSetHdrTest::Striped_treap_set_basehook()
29 typedef ci::StripedSet<
30 bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
31 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
32 ,co::mutex_policy< ci::striped_set::striping<> >
38 void IntrusiveStripedSetHdrTest::Striped_treap_set_basehook_bucket_threshold()
40 typedef ci::StripedSet<
41 bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
42 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
43 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
49 void IntrusiveStripedSetHdrTest::Striped_treap_set_basehook_bucket_threshold_rt()
51 typedef ci::StripedSet<
52 bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
53 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
54 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
57 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
61 void IntrusiveStripedSetHdrTest::Striped_treap_set_memberhook()
63 typedef ci::StripedSet<
66 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
67 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
68 , bi::priority<priority_cmp<member_item_type> >
70 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
76 void IntrusiveStripedSetHdrTest::Striped_treap_set_memberhook_bucket_threshold()
78 typedef ci::StripedSet<
81 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
82 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
83 , bi::priority<priority_cmp<member_item_type> >
85 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
86 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
92 void IntrusiveStripedSetHdrTest::Striped_treap_set_memberhook_bucket_threshold_rt()
94 typedef ci::StripedSet<
97 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
98 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
99 , bi::priority<priority_cmp<member_item_type> >
101 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
102 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
105 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );