rename michael_kvlist_pth.h to michael_kvlist_dhp.h
[libcds.git] / tests / test-hdr / set / hdr_intrusive_splitlist_set_hrc.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_set.h"
4 #include <cds/intrusive/michael_list_hrc.h>
5 #include <cds/intrusive/split_list.h>
6
7 namespace set {
8
9     void IntrusiveHashSetHdrTest::split_dyn_HRC_base_cmp()
10     {
11         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HRC> > > item;
12         typedef ci::MichaelList< cds::gc::HRC
13             ,item
14             ,ci::michael_list::make_traits<
15                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HRC> > >
16                 ,co::compare< cmp<item> >
17                 ,ci::opt::disposer< faked_disposer >
18             >::type
19         >    ord_list;
20
21         typedef ci::SplitListSet< cds::gc::HRC, ord_list,
22             ci::split_list::make_traits<
23                 co::hash< hash_int >
24                 ,ci::split_list::dynamic_bucket_table<true>
25                 ,co::memory_model<co::v::relaxed_ordering>
26             >::type
27         > set;
28         static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
29
30         test_int<set>();
31     }
32
33     void IntrusiveHashSetHdrTest::split_dyn_HRC_base_less()
34     {
35         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HRC> > > item;
36         typedef ci::MichaelList< cds::gc::HRC
37             ,item
38             ,ci::michael_list::make_traits<
39                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HRC> > >
40                 ,co::less< less<item> >
41                 ,ci::opt::disposer< faked_disposer >
42             >::type
43         >    ord_list;
44
45         typedef ci::SplitListSet< cds::gc::HRC, ord_list,
46             ci::split_list::make_traits<
47                 co::hash< hash_int >
48                 ,co::memory_model<co::v::sequential_consistent>
49             >::type
50         > set;
51         static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
52
53         test_int<set>();
54     }
55
56     void IntrusiveHashSetHdrTest::split_dyn_HRC_base_cmpmix()
57     {
58         typedef base_int_item< ci::split_list::node<ci::michael_list::node<cds::gc::HRC> > > item;
59         typedef ci::MichaelList< cds::gc::HRC
60             ,item
61             ,ci::michael_list::make_traits<
62                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HRC> > >
63                 ,co::less< less<item> >
64                 ,co::compare< cmp<item> >
65                 ,ci::opt::disposer< faked_disposer >
66             >::type
67         >    ord_list;
68
69         typedef ci::SplitListSet< cds::gc::HRC, ord_list,
70             ci::split_list::make_traits<
71                 co::hash< hash_int >
72                 ,co::item_counter< simple_item_counter >
73                 ,ci::split_list::dynamic_bucket_table<true>
74             >::type
75         > set;
76         static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
77
78         test_int<set>();
79     }
80
81     // Static bucket table
82     void IntrusiveHashSetHdrTest::split_st_HRC_base_cmp()
83     {
84         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HRC> > > item;
85         typedef ci::MichaelList< cds::gc::HRC
86             ,item
87             ,ci::michael_list::make_traits<
88                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HRC> > >
89                 ,co::compare< cmp<item> >
90                 ,ci::opt::disposer< faked_disposer >
91             >::type
92         >    ord_list;
93
94         typedef ci::SplitListSet< cds::gc::HRC, ord_list,
95             ci::split_list::make_traits<
96                 co::hash< hash_int >
97                 ,ci::split_list::dynamic_bucket_table<false>
98                 ,co::memory_model<co::v::relaxed_ordering>
99             >::type
100         > set;
101         static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
102
103         test_int<set>();
104     }
105
106     void IntrusiveHashSetHdrTest::split_st_HRC_base_less()
107     {
108         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HRC> > > item;
109         typedef ci::MichaelList< cds::gc::HRC
110             ,item
111             ,ci::michael_list::make_traits<
112                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HRC> > >
113                 ,co::less< less<item> >
114                 ,ci::opt::disposer< faked_disposer >
115             >::type
116         >    ord_list;
117
118         typedef ci::SplitListSet< cds::gc::HRC, ord_list,
119             ci::split_list::make_traits<
120                 co::hash< hash_int >
121                 ,ci::split_list::dynamic_bucket_table<false>
122                 ,co::memory_model<co::v::sequential_consistent>
123             >::type
124         > set;
125         static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
126
127         test_int<set>();
128     }
129
130     void IntrusiveHashSetHdrTest::split_st_HRC_base_cmpmix()
131     {
132         typedef base_int_item< ci::split_list::node<ci::michael_list::node<cds::gc::HRC> > > item;
133         typedef ci::MichaelList< cds::gc::HRC
134             ,item
135             ,ci::michael_list::make_traits<
136                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HRC> > >
137                 ,co::less< less<item> >
138                 ,co::compare< cmp<item> >
139                 ,ci::opt::disposer< faked_disposer >
140             >::type
141         >    ord_list;
142
143         typedef ci::SplitListSet< cds::gc::HRC, ord_list,
144             ci::split_list::make_traits<
145                 co::hash< hash_int >
146                 ,co::item_counter< simple_item_counter >
147                 ,ci::split_list::dynamic_bucket_table<false>
148             >::type
149         > set;
150         static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
151
152         test_int<set>();
153     }
154
155 } // namespace set