Move libcds 1.6.0 from SVN
[libcds.git] / tests / test-hdr / set / hdr_intrusive_splitlist_set_nogc.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_set.h"
4 #include <cds/intrusive/michael_list_nogc.h>
5 #include <cds/intrusive/split_list_nogc.h>
6
7 namespace set {
8
9     void IntrusiveHashSetHdrTest::split_dyn_nogc_base_cmp()
10     {
11         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
12         typedef ci::MichaelList< cds::gc::nogc
13             ,item
14             ,ci::michael_list::make_traits<
15                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
16                 ,co::compare< cmp<item> >
17                 ,ci::opt::disposer< faked_disposer >
18             >::type
19         >    bucket_type;
20
21         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
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
29         test_int_nogc<set>();
30     }
31
32     void IntrusiveHashSetHdrTest::split_dyn_nogc_base_less()
33     {
34         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
35         typedef ci::MichaelList< cds::gc::nogc
36             ,item
37             ,ci::michael_list::make_traits<
38                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
39                 ,co::less< less<item> >
40                 ,ci::opt::disposer< faked_disposer >
41             >::type
42         >    bucket_type;
43
44         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
45             ci::split_list::make_traits<
46                 co::hash< hash_int >
47                 ,ci::split_list::dynamic_bucket_table<true>
48                 ,co::memory_model<co::v::sequential_consistent>
49             >::type
50         > set;
51
52         test_int_nogc<set>();
53     }
54
55     void IntrusiveHashSetHdrTest::split_dyn_nogc_base_cmpmix()
56     {
57         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
58         typedef ci::MichaelList< cds::gc::nogc
59             ,item
60             ,ci::michael_list::make_traits<
61                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
62                 ,co::less< less<item> >
63                 ,co::compare< cmp<item> >
64                 ,ci::opt::disposer< faked_disposer >
65             >::type
66         >    bucket_type;
67
68         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
69             ci::split_list::make_traits<
70                 co::hash< hash_int >
71                 ,co::item_counter< simple_item_counter >
72                 ,ci::split_list::dynamic_bucket_table<true>
73             >::type
74         > set;
75
76         test_int_nogc<set>();
77     }
78
79     void IntrusiveHashSetHdrTest::split_dyn_nogc_member_cmp()
80     {
81         typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
82         typedef ci::MichaelList< cds::gc::nogc
83             ,item
84             ,ci::michael_list::make_traits<
85                 ci::opt::hook< ci::michael_list::member_hook<
86                     offsetof( item, hMember ),
87                     co::gc<cds::gc::nogc>
88                 > >
89                 ,co::compare< cmp<item> >
90                 ,ci::opt::disposer< faked_disposer >
91             >::type
92         >    bucket_type;
93
94         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
95             ci::split_list::make_traits<
96                 co::hash< hash_int >
97                 ,ci::split_list::dynamic_bucket_table<true>
98                 ,co::memory_model<co::v::relaxed_ordering>
99             >::type
100         > set;
101
102         test_int_nogc<set>();
103     }
104
105     void IntrusiveHashSetHdrTest::split_dyn_nogc_member_less()
106     {
107         typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
108         typedef ci::MichaelList< cds::gc::nogc
109             ,item
110             ,ci::michael_list::make_traits<
111                 ci::opt::hook< ci::michael_list::member_hook<
112                     offsetof( item, hMember ),
113                     co::gc<cds::gc::nogc>
114                 > >
115                 ,co::less< less<item> >
116                 ,ci::opt::disposer< faked_disposer >
117             >::type
118         >    bucket_type;
119
120         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
121             ci::split_list::make_traits<
122                 co::hash< hash_int >
123                 ,ci::split_list::dynamic_bucket_table<true>
124                 ,co::memory_model<co::v::sequential_consistent>
125             >::type
126         > set;
127
128         test_int_nogc<set>();
129     }
130
131     void IntrusiveHashSetHdrTest::split_dyn_nogc_member_cmpmix()
132     {
133         typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
134         typedef ci::MichaelList< cds::gc::nogc
135             ,item
136             ,ci::michael_list::make_traits<
137                 ci::opt::hook< ci::michael_list::member_hook<
138                     offsetof( item, hMember ),
139                     co::gc<cds::gc::nogc>
140                 > >
141                 ,co::compare< cmp<item> >
142                 ,co::less< less<item> >
143                 ,ci::opt::disposer< faked_disposer >
144             >::type
145         >    bucket_type;
146
147         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
148             ci::split_list::make_traits<
149                 co::hash< hash_int >
150                 ,co::item_counter< simple_item_counter >
151                 ,ci::split_list::dynamic_bucket_table<true>
152             >::type
153         > set;
154
155         test_int_nogc<set>();
156     }
157
158
159     // Static bucket table
160     void IntrusiveHashSetHdrTest::split_st_nogc_base_cmp()
161     {
162         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
163         typedef ci::MichaelList< cds::gc::nogc
164             ,item
165             ,ci::michael_list::make_traits<
166                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
167                 ,co::compare< cmp<item> >
168                 ,ci::opt::disposer< faked_disposer >
169             >::type
170         >    bucket_type;
171
172         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
173             ci::split_list::make_traits<
174                 co::hash< hash_int >
175                 ,ci::split_list::dynamic_bucket_table<false>
176                 ,co::memory_model<co::v::relaxed_ordering>
177             >::type
178         > set;
179
180         test_int_nogc<set>();
181     }
182
183     void IntrusiveHashSetHdrTest::split_st_nogc_base_less()
184     {
185         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
186         typedef ci::MichaelList< cds::gc::nogc
187             ,item
188             ,ci::michael_list::make_traits<
189                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
190                 ,co::less< less<item> >
191                 ,ci::opt::disposer< faked_disposer >
192             >::type
193         >    bucket_type;
194
195         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
196             ci::split_list::make_traits<
197                 co::hash< hash_int >
198                 ,ci::split_list::dynamic_bucket_table<false>
199                 ,co::memory_model<co::v::sequential_consistent>
200             >::type
201         > set;
202
203         test_int_nogc<set>();
204     }
205
206     void IntrusiveHashSetHdrTest::split_st_nogc_base_cmpmix()
207     {
208         typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
209         typedef ci::MichaelList< cds::gc::nogc
210             ,item
211             ,ci::michael_list::make_traits<
212                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
213                 ,co::less< less<item> >
214                 ,co::compare< cmp<item> >
215                 ,ci::opt::disposer< faked_disposer >
216             >::type
217         >    bucket_type;
218
219         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
220             ci::split_list::make_traits<
221                 co::hash< hash_int >
222                 ,co::item_counter< simple_item_counter >
223                 ,ci::split_list::dynamic_bucket_table<false>
224             >::type
225         > set;
226
227         test_int_nogc<set>();
228     }
229
230     void IntrusiveHashSetHdrTest::split_st_nogc_member_cmp()
231     {
232         typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
233         typedef ci::MichaelList< cds::gc::nogc
234             ,item
235             ,ci::michael_list::make_traits<
236                 ci::opt::hook< ci::michael_list::member_hook<
237                     offsetof( item, hMember ),
238                     co::gc<cds::gc::nogc>
239                 > >
240                 ,co::compare< cmp<item> >
241                 ,ci::opt::disposer< faked_disposer >
242             >::type
243         >    bucket_type;
244
245         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
246             ci::split_list::make_traits<
247                 co::hash< hash_int >
248                 ,ci::split_list::dynamic_bucket_table<false>
249                 ,co::memory_model<co::v::sequential_consistent>
250             >::type
251         > set;
252
253         test_int_nogc<set>();
254     }
255
256     void IntrusiveHashSetHdrTest::split_st_nogc_member_less()
257     {
258         typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
259         typedef ci::MichaelList< cds::gc::nogc
260             ,item
261             ,ci::michael_list::make_traits<
262                 ci::opt::hook< ci::michael_list::member_hook<
263                     offsetof( item, hMember ),
264                     co::gc<cds::gc::nogc>
265                 > >
266                 ,co::less< less<item> >
267                 ,ci::opt::disposer< faked_disposer >
268             >::type
269         >    bucket_type;
270
271         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
272             ci::split_list::make_traits<
273                 co::hash< hash_int >
274                 ,ci::split_list::dynamic_bucket_table<false>
275                 ,co::memory_model<co::v::relaxed_ordering>
276             >::type
277         > set;
278
279         test_int_nogc<set>();
280     }
281
282     void IntrusiveHashSetHdrTest::split_st_nogc_member_cmpmix()
283     {
284         typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::nogc> > > item;
285         typedef ci::MichaelList< cds::gc::nogc
286             ,item
287             ,ci::michael_list::make_traits<
288                 ci::opt::hook< ci::michael_list::member_hook<
289                     offsetof( item, hMember ),
290                     co::gc<cds::gc::nogc>
291                 > >
292                 ,co::compare< cmp<item> >
293                 ,co::less< less<item> >
294                 ,ci::opt::disposer< faked_disposer >
295             >::type
296         >    bucket_type;
297
298         typedef ci::SplitListSet< cds::gc::nogc, bucket_type,
299             ci::split_list::make_traits<
300                 co::hash< hash_int >
301                 ,co::item_counter< simple_item_counter >
302                 ,ci::split_list::dynamic_bucket_table<false>
303             >::type
304         > set;
305
306         test_int_nogc<set>();
307     }
308
309 } // namespace set