bugfix in cds::gc::HP::guarded_ptr
[libcds.git] / tests / test-hdr / set / hdr_intrusive_refinable_hashset_splayset.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_striped_set.h"
4 #include <cds/intrusive/striped_set/boost_splay_set.h>
5 #include <cds/intrusive/striped_set.h>
6 #include <boost/version.hpp>
7
8 namespace set {
9     namespace bi = boost::intrusive;
10
11     namespace {
12 #   if BOOST_VERSION < 105600
13         typedef bi::splay_set_member_hook<> splay_set_member_hook;
14         typedef bi::splay_set_base_hook<> splay_set_base_hook;
15 #else
16         typedef bi::bs_set_base_hook<> splay_set_base_hook;
17         typedef bi::bs_set_member_hook<> splay_set_member_hook;
18 #endif
19         typedef IntrusiveStripedSetHdrTest::base_item< splay_set_base_hook > base_item_type;
20         typedef IntrusiveStripedSetHdrTest::member_item< splay_set_member_hook > member_item_type;
21     }
22
23     void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook()
24     {
25         typedef ci::StripedSet<
26             bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
27             ,co::mutex_policy< ci::striped_set::refinable<> >
28             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
29             ,co::back_off< cds::backoff::empty >
30         > set_type;
31
32         test<set_type>();
33     }
34
35     void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook_bucket_threshold()
36     {
37         typedef ci::StripedSet<
38             bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
39             ,co::mutex_policy< ci::striped_set::refinable<> >
40             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
41             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
42         > set_type;
43
44         test<set_type>();
45     }
46
47     void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook_bucket_threshold_rt()
48     {
49         typedef ci::StripedSet<
50             bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
51             ,co::mutex_policy< ci::striped_set::refinable<> >
52             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
53             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
54         > set_type;
55
56         set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
57         test_with( s );
58     }
59
60     void IntrusiveStripedSetHdrTest::Refinable_splay_set_memberhook()
61     {
62         typedef ci::StripedSet<
63             bi::splay_set<
64                 member_item_type
65                 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
66                 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
67             >
68             ,co::mutex_policy< ci::striped_set::refinable<> >
69             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
70         > set_type;
71
72         test<set_type>();
73     }
74
75     void IntrusiveStripedSetHdrTest::Refinable_splay_set_memberhook_bucket_threshold()
76     {
77         typedef ci::StripedSet<
78             bi::splay_set<
79                 member_item_type
80                 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
81                 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
82             >
83             ,co::mutex_policy< ci::striped_set::refinable<> >
84             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
85             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
86         > set_type;
87
88         test<set_type>();
89     }
90
91     void IntrusiveStripedSetHdrTest::Refinable_splay_set_memberhook_bucket_threshold_rt()
92     {
93         typedef ci::StripedSet<
94             bi::splay_set<
95                 member_item_type
96                 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
97                 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
98             >
99             ,co::mutex_policy< ci::striped_set::refinable<> >
100             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
101             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
102         > set_type;
103
104         set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
105         test_with( s );
106     }
107 } // namespace set
108
109