3 #include "set/hdr_intrusive_set.h"
4 #include <cds/intrusive/michael_list_hp.h>
5 #include <cds/intrusive/split_list.h>
9 void IntrusiveHashSetHdrTest::split_dyn_HP_base_cmp()
11 typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
12 typedef ci::MichaelList< cds::gc::HP
14 ,ci::michael_list::make_traits<
15 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
16 ,co::compare< cmp<item> >
17 ,ci::opt::disposer< faked_disposer >
21 typedef ci::SplitListSet< cds::gc::HP, ord_list,
22 ci::split_list::make_traits<
24 ,ci::split_list::dynamic_bucket_table<true>
25 ,co::memory_model<co::v::relaxed_ordering>
28 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
33 void IntrusiveHashSetHdrTest::split_dyn_HP_base_less()
35 typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
36 typedef ci::MichaelList< cds::gc::HP
38 ,ci::michael_list::make_traits<
39 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
40 ,co::less< less<item> >
41 ,ci::opt::disposer< faked_disposer >
45 typedef ci::SplitListSet< cds::gc::HP, ord_list,
46 ci::split_list::make_traits<
48 ,co::memory_model<co::v::sequential_consistent>
51 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
56 void IntrusiveHashSetHdrTest::split_dyn_HP_base_cmpmix()
58 typedef base_int_item< ci::split_list::node<ci::michael_list::node<cds::gc::HP> > > item;
59 typedef ci::MichaelList< cds::gc::HP
61 ,ci::michael_list::make_traits<
62 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
63 ,co::less< less<item> >
64 ,co::compare< cmp<item> >
65 ,ci::opt::disposer< faked_disposer >
69 typedef ci::SplitListSet< cds::gc::HP, ord_list,
70 ci::split_list::make_traits<
72 ,co::item_counter< simple_item_counter >
73 ,ci::split_list::dynamic_bucket_table<true>
76 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
81 void IntrusiveHashSetHdrTest::split_dyn_HP_base_cmpmix_stat()
83 typedef base_int_item< ci::split_list::node<ci::michael_list::node<cds::gc::HP> > > item;
84 typedef ci::MichaelList< cds::gc::HP
86 ,ci::michael_list::make_traits<
87 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
88 ,co::less< less<item> >
89 ,co::compare< cmp<item> >
90 ,ci::opt::disposer< faked_disposer >
94 typedef ci::SplitListSet< cds::gc::HP, ord_list,
95 ci::split_list::make_traits<
97 ,co::item_counter< simple_item_counter >
98 ,ci::split_list::dynamic_bucket_table<true>
99 ,co::stat< ci::split_list::stat<> >
102 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
107 void IntrusiveHashSetHdrTest::split_dyn_HP_member_cmp()
109 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
110 typedef ci::MichaelList< cds::gc::HP
112 ,ci::michael_list::make_traits<
113 ci::opt::hook< ci::michael_list::member_hook<
114 offsetof( item, hMember ),
117 ,co::compare< cmp<item> >
118 ,ci::opt::disposer< faked_disposer >
122 typedef ci::SplitListSet< cds::gc::HP, ord_list,
123 ci::split_list::make_traits<
125 ,co::memory_model<co::v::relaxed_ordering>
128 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
133 void IntrusiveHashSetHdrTest::split_dyn_HP_member_less()
135 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
136 typedef ci::MichaelList< cds::gc::HP
138 ,ci::michael_list::make_traits<
139 ci::opt::hook< ci::michael_list::member_hook<
140 offsetof( item, hMember ),
143 ,co::less< less<item> >
144 ,ci::opt::disposer< faked_disposer >
148 typedef ci::SplitListSet< cds::gc::HP, ord_list,
149 ci::split_list::make_traits<
151 ,co::memory_model<co::v::sequential_consistent>
154 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
159 void IntrusiveHashSetHdrTest::split_dyn_HP_member_cmpmix()
161 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
162 typedef ci::MichaelList< cds::gc::HP
164 ,ci::michael_list::make_traits<
165 ci::opt::hook< ci::michael_list::member_hook<
166 offsetof( item, hMember ),
169 ,co::compare< cmp<item> >
170 ,co::less< less<item> >
171 ,ci::opt::disposer< faked_disposer >
175 typedef ci::SplitListSet< cds::gc::HP, ord_list,
176 ci::split_list::make_traits<
178 ,co::item_counter< simple_item_counter >
179 , ci::split_list::dynamic_bucket_table<true>
182 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
187 void IntrusiveHashSetHdrTest::split_dyn_HP_member_cmpmix_stat()
189 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
190 struct list_traits : public ci::michael_list::traits {
191 typedef ci::michael_list::member_hook< offsetof( item, hMember ), co::gc<cds::gc::HP>> hook;
192 typedef cmp<item> compare;
193 typedef IntrusiveHashSetHdrTest::less<item> less;
194 typedef faked_disposer disposer;
196 typedef ci::MichaelList< cds::gc::HP, item, list_traits > ord_list;
198 struct set_traits : public ci::split_list::traits {
199 typedef hash_int hash;
200 typedef simple_item_counter item_counter;
201 typedef ci::split_list::stat<> stat;
203 typedef ci::SplitListSet< cds::gc::HP, ord_list, set_traits > set;
205 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
210 // Static bucket table
211 void IntrusiveHashSetHdrTest::split_st_HP_base_cmp()
213 typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
214 typedef ci::MichaelList< cds::gc::HP
216 ,ci::michael_list::make_traits<
217 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
218 ,co::compare< cmp<item> >
219 ,ci::opt::disposer< faked_disposer >
223 typedef ci::SplitListSet< cds::gc::HP, ord_list,
224 ci::split_list::make_traits<
226 ,ci::split_list::dynamic_bucket_table<false>
227 ,co::memory_model<co::v::relaxed_ordering>
230 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
235 void IntrusiveHashSetHdrTest::split_st_HP_base_less()
237 typedef base_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
238 typedef ci::MichaelList< cds::gc::HP
240 ,ci::michael_list::make_traits<
241 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
242 ,co::less< less<item> >
243 ,ci::opt::disposer< faked_disposer >
247 typedef ci::SplitListSet< cds::gc::HP, ord_list,
248 ci::split_list::make_traits<
250 ,ci::split_list::dynamic_bucket_table<false>
251 ,co::memory_model<co::v::sequential_consistent>
254 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
259 void IntrusiveHashSetHdrTest::split_st_HP_base_cmpmix()
261 typedef base_int_item< ci::split_list::node<ci::michael_list::node<cds::gc::HP> > > item;
262 typedef ci::MichaelList< cds::gc::HP
264 ,ci::michael_list::make_traits<
265 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
266 ,co::less< less<item> >
267 ,co::compare< cmp<item> >
268 ,ci::opt::disposer< faked_disposer >
272 typedef ci::SplitListSet< cds::gc::HP, ord_list,
273 ci::split_list::make_traits<
275 ,co::item_counter< simple_item_counter >
276 ,ci::split_list::dynamic_bucket_table<false>
279 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
284 void IntrusiveHashSetHdrTest::split_st_HP_base_cmpmix_stat()
286 typedef base_int_item< ci::split_list::node<ci::michael_list::node<cds::gc::HP> > > item;
288 public ci::michael_list::make_traits<
289 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
290 ,co::less< less<item> >
291 ,co::compare< cmp<item> >
292 ,ci::opt::disposer< faked_disposer >
295 typedef ci::MichaelList< cds::gc::HP, item, list_traits > ord_list;
298 public ci::split_list::make_traits<
300 ,co::item_counter< simple_item_counter >
301 ,ci::split_list::dynamic_bucket_table<false>
302 ,co::stat< ci::split_list::stat<> >
305 typedef ci::SplitListSet< cds::gc::HP, ord_list, set_traits > set;
307 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
312 void IntrusiveHashSetHdrTest::split_st_HP_member_cmp()
314 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
315 typedef ci::MichaelList< cds::gc::HP
317 ,ci::michael_list::make_traits<
318 ci::opt::hook< ci::michael_list::member_hook<
319 offsetof( item, hMember ),
322 ,co::compare< cmp<item> >
323 ,ci::opt::disposer< faked_disposer >
327 typedef ci::SplitListSet< cds::gc::HP, ord_list,
328 ci::split_list::make_traits<
330 ,ci::split_list::dynamic_bucket_table<false>
331 ,co::memory_model<co::v::relaxed_ordering>
334 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
339 void IntrusiveHashSetHdrTest::split_st_HP_member_less()
341 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
342 typedef ci::MichaelList< cds::gc::HP
344 ,ci::michael_list::make_traits<
345 ci::opt::hook< ci::michael_list::member_hook<
346 offsetof( item, hMember ),
349 ,co::less< less<item> >
350 ,ci::opt::disposer< faked_disposer >
354 typedef ci::SplitListSet< cds::gc::HP, ord_list,
355 ci::split_list::make_traits<
356 ci::split_list::dynamic_bucket_table<false>
357 ,co::hash< hash_int >
358 ,co::memory_model<co::v::sequential_consistent>
361 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
366 void IntrusiveHashSetHdrTest::split_st_HP_member_cmpmix()
368 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
369 typedef ci::MichaelList< cds::gc::HP
371 ,ci::michael_list::make_traits<
372 ci::opt::hook< ci::michael_list::member_hook<
373 offsetof( item, hMember ),
376 ,co::compare< cmp<item> >
377 ,co::less< less<item> >
378 ,ci::opt::disposer< faked_disposer >
382 typedef ci::SplitListSet< cds::gc::HP, ord_list,
383 ci::split_list::make_traits<
385 ,co::item_counter< simple_item_counter >
386 ,ci::split_list::dynamic_bucket_table<false>
389 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
394 void IntrusiveHashSetHdrTest::split_st_HP_member_cmpmix_stat()
396 typedef member_int_item< ci::split_list::node< ci::michael_list::node<cds::gc::HP> > > item;
397 typedef ci::MichaelList< cds::gc::HP
399 ,ci::michael_list::make_traits<
400 ci::opt::hook< ci::michael_list::member_hook<
401 offsetof( item, hMember ),
404 ,co::compare< cmp<item> >
405 ,co::less< less<item> >
406 ,ci::opt::disposer< faked_disposer >
410 typedef ci::SplitListSet< cds::gc::HP, ord_list,
411 ci::split_list::make_traits<
413 ,co::item_counter< simple_item_counter >
414 ,ci::split_list::dynamic_bucket_table<false>
415 ,co::stat< ci::split_list::stat<> >
418 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );