Move libcds 1.6.0 from SVN
[libcds.git] / tests / test-hdr / set / hdr_intrusive_refinable_hashset_sgset.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_striped_set.h"
4 #include <cds/intrusive/striped_set/boost_sg_set.h>
5 #include <cds/intrusive/striped_set.h>
6
7 namespace set {
8     namespace bi = boost::intrusive;
9
10     namespace {
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;
13     }
14
15     void IntrusiveStripedSetHdrTest::Refinable_sg_set_basehook()
16     {
17         typedef ci::StripedSet<
18             bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
19             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
20             ,co::mutex_policy< ci::striped_set::refinable<> >
21         > set_type;
22
23         test<set_type>();
24     }
25
26     void IntrusiveStripedSetHdrTest::Refinable_sg_set_basehook_bucket_threshold()
27     {
28         typedef ci::StripedSet<
29             bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
30             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
31             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
32             ,co::mutex_policy< ci::striped_set::refinable<> >
33         > set_type;
34
35         test<set_type>();
36     }
37
38     void IntrusiveStripedSetHdrTest::Refinable_sg_set_basehook_bucket_threshold_rt()
39     {
40         typedef ci::StripedSet<
41             bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
42             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
43             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
44             ,co::mutex_policy< ci::striped_set::refinable<> >
45         > set_type;
46
47         set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
48         test_with( s );
49     }
50
51     void IntrusiveStripedSetHdrTest::Refinable_sg_set_memberhook()
52     {
53         typedef ci::StripedSet<
54             bi::sg_set<
55                 member_item_type
56                 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
57                 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
58             >
59             ,co::mutex_policy< ci::striped_set::refinable<> >
60             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
61         > set_type;
62
63         test<set_type>();
64     }
65
66     void IntrusiveStripedSetHdrTest::Refinable_sg_set_memberhook_bucket_threshold()
67     {
68         typedef ci::StripedSet<
69             bi::sg_set<
70                 member_item_type
71                 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
72                 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
73             >
74             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
75             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
76             ,co::mutex_policy< ci::striped_set::refinable<> >
77         > set_type;
78
79         test<set_type>();
80     }
81
82     void IntrusiveStripedSetHdrTest::Refinable_sg_set_memberhook_bucket_threshold_rt()
83     {
84         typedef ci::StripedSet<
85             bi::sg_set<
86                 member_item_type
87                 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
88                 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
89             >
90             ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
91             ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
92             ,co::mutex_policy< ci::striped_set::refinable<> >
93         > set_type;
94
95         set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
96         test_with( s );
97     }
98
99 } // namespace set
100
101