3 #include "set/hdr_set.h"
4 #include <cds/container/lazy_list_nogc.h>
5 #include <cds/container/split_list_set_nogc.h>
10 struct nogc_cmp_traits: public cc::split_list::traits
12 typedef cc::lazy_list_tag ordered_list;
13 typedef HashSetHdrTest::hash_int hash;
14 typedef HashSetHdrTest::simple_item_counter item_counter;
15 typedef cc::opt::v::relaxed_ordering memory_model;
16 enum { dynamic_bucket_table = false };
18 struct ordered_list_traits: public cc::lazy_list::traits
20 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
24 struct nogc_less_traits: public cc::split_list::traits
26 typedef cc::lazy_list_tag ordered_list;
27 typedef HashSetHdrTest::hash_int hash;
28 typedef HashSetHdrTest::simple_item_counter item_counter;
29 typedef cc::opt::v::sequential_consistent memory_model;
30 enum { dynamic_bucket_table = false };
32 struct ordered_list_traits: public cc::lazy_list::traits
34 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
38 struct nogc_cmpmix_traits: public cc::split_list::traits
40 typedef cc::lazy_list_tag ordered_list;
41 typedef HashSetHdrTest::hash_int hash;
42 typedef HashSetHdrTest::simple_item_counter item_counter;
44 struct ordered_list_traits: public cc::lazy_list::traits
46 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
47 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
51 struct nogc_cmpmix_stat_traits : public nogc_cmpmix_traits
53 typedef cc::split_list::stat<> stat;
57 void HashSetHdrTest::Split_Lazy_nogc_cmp()
59 // traits-based version
60 typedef cc::SplitListSet< cds::gc::nogc, item, nogc_cmp_traits > set;
62 test_int_nogc< set >();
64 // option-based version
65 typedef cc::SplitListSet< cds::gc::nogc, item,
66 cc::split_list::make_traits<
67 cc::split_list::ordered_list<cc::lazy_list_tag>
68 ,cc::opt::hash< hash_int >
69 ,cc::opt::item_counter< simple_item_counter >
70 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
71 ,cc::split_list::dynamic_bucket_table< true >
72 ,cc::split_list::ordered_list_traits<
73 cc::lazy_list::make_traits<
74 cc::opt::compare< cmp<item> >
79 test_int_nogc< opt_set >();
82 void HashSetHdrTest::Split_Lazy_nogc_less()
84 // traits-based version
85 typedef cc::SplitListSet< cds::gc::nogc, item, nogc_less_traits > set;
87 test_int_nogc< set >();
89 // option-based version
90 typedef cc::SplitListSet< cds::gc::nogc, item,
91 cc::split_list::make_traits<
92 cc::split_list::ordered_list<cc::lazy_list_tag>
93 ,cc::opt::hash< hash_int >
94 ,cc::opt::item_counter< simple_item_counter >
95 ,cc::opt::memory_model< cc::opt::v::sequential_consistent >
96 ,cc::split_list::dynamic_bucket_table< false >
97 ,cc::split_list::ordered_list_traits<
98 cc::lazy_list::make_traits<
99 cc::opt::less< less<item> >
104 test_int_nogc< opt_set >();
107 void HashSetHdrTest::Split_Lazy_nogc_cmpmix()
109 // traits-based version
110 typedef cc::SplitListSet< cds::gc::nogc, item, nogc_cmpmix_traits > set;
111 test_int_nogc< set >();
113 // option-based version
114 typedef cc::SplitListSet< cds::gc::nogc, item,
115 cc::split_list::make_traits<
116 cc::split_list::ordered_list<cc::lazy_list_tag>
117 ,cc::opt::hash< hash_int >
118 ,cc::opt::item_counter< simple_item_counter >
119 ,cc::split_list::ordered_list_traits<
120 cc::lazy_list::make_traits<
121 cc::opt::less< less<item> >
122 ,cc::opt::compare< cmp<item> >
127 test_int_nogc< opt_set >();
130 void HashSetHdrTest::Split_Lazy_nogc_cmpmix_stat()
132 // traits-based version
133 typedef cc::SplitListSet< cds::gc::nogc, item, nogc_cmpmix_stat_traits > set;
134 test_int_nogc< set >();
136 // option-based version
137 typedef cc::SplitListSet< cds::gc::nogc, item,
138 cc::split_list::make_traits<
139 cc::split_list::ordered_list<cc::lazy_list_tag>
140 ,cc::opt::hash< hash_int >
141 ,cds::opt::stat< cc::split_list::stat<>>
142 ,cc::opt::item_counter< simple_item_counter >
143 ,cc::split_list::ordered_list_traits<
144 cc::lazy_list::make_traits<
145 cc::opt::less< less<item> >
146 ,cc::opt::compare< cmp<item> >
151 test_int_nogc< opt_set >();