3 #include "set/hdr_set.h"
4 #include <cds/container/lazy_list_nogc.h>
5 #include <cds/container/michael_set_nogc.h>
10 struct set_traits: public cc::michael_set::traits
12 typedef HashSetHdrTest::hash_int hash;
13 typedef HashSetHdrTest::simple_item_counter item_counter;
16 struct nogc_cmp_traits: public cc::lazy_list::traits
18 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
21 struct nogc_less_traits: public cc::lazy_list::traits
23 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
26 struct nogc_equal_traits: public cc::lazy_list::traits
28 typedef HashSetHdrTest::equal<HashSetHdrTest::item> equal_to;
29 static const bool sort = false;
32 struct nogc_cmpmix_traits: public cc::lazy_list::traits
34 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
35 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
39 void HashSetHdrTest::Lazy_nogc_cmp()
41 typedef cc::LazyList< cds::gc::nogc, item, nogc_cmp_traits > list;
43 // traits-based version
44 typedef cc::MichaelHashSet< cds::gc::nogc, list, set_traits > set;
45 test_int_nogc< set >();
47 // option-based version
48 typedef cc::MichaelHashSet< cds::gc::nogc, list,
49 cc::michael_set::make_traits<
50 cc::opt::hash< hash_int >
51 ,cc::opt::item_counter< simple_item_counter >
54 test_int_nogc< opt_set >();
57 void HashSetHdrTest::Lazy_nogc_less()
59 typedef cc::LazyList< cds::gc::nogc, item, nogc_less_traits > list;
61 // traits-based version
62 typedef cc::MichaelHashSet< cds::gc::nogc, list, set_traits > set;
63 test_int_nogc< set >();
65 // option-based version
66 typedef cc::MichaelHashSet< cds::gc::nogc, list,
67 cc::michael_set::make_traits<
68 cc::opt::hash< hash_int >
69 ,cc::opt::item_counter< simple_item_counter >
72 test_int_nogc< opt_set >();
75 void HashSetHdrTest::Lazy_nogc_equal()
77 typedef cc::LazyList< cds::gc::nogc, item, nogc_equal_traits > list;
79 // traits-based version
80 typedef cc::MichaelHashSet< cds::gc::nogc, list, set_traits > set;
81 test_int_nogc_unordered< set >();
83 // option-based version
84 typedef cc::MichaelHashSet< cds::gc::nogc, list,
85 cc::michael_set::make_traits<
86 cc::opt::hash< hash_int >
87 ,cc::opt::item_counter< simple_item_counter >
90 test_int_nogc_unordered< opt_set >();
93 void HashSetHdrTest::Lazy_nogc_cmpmix()
95 typedef cc::LazyList< cds::gc::nogc, item, nogc_cmpmix_traits > list;
97 // traits-based version
98 typedef cc::MichaelHashSet< cds::gc::nogc, list, set_traits > set;
99 test_int_nogc< set >();
101 // option-based version
102 typedef cc::MichaelHashSet< cds::gc::nogc, list,
103 cc::michael_set::make_traits<
104 cc::opt::hash< hash_int >
105 ,cc::opt::item_counter< simple_item_counter >
108 test_int_nogc< opt_set >();