3 #include "set/hdr_set.h"
4 #include <cds/container/lazy_list_dhp.h>
5 #include <cds/container/split_list_set.h>
10 struct DHP_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 DHP_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 DHP_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 DHP_cmpmix_stat_traits : public DHP_cmpmix_traits
53 typedef cc::split_list::stat<> stat;
57 void HashSetHdrTest::Split_Lazy_DHP_cmp()
59 // traits-based version
60 typedef cc::SplitListSet< cds::gc::DHP, item, DHP_cmp_traits > set;
64 // option-based version
65 typedef cc::SplitListSet< cds::gc::DHP, 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< opt_set >();
82 void HashSetHdrTest::Split_Lazy_DHP_less()
84 // traits-based version
85 typedef cc::SplitListSet< cds::gc::DHP, item, DHP_less_traits > set;
89 // option-based version
90 typedef cc::SplitListSet< cds::gc::DHP, 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< opt_set >();
107 void HashSetHdrTest::Split_Lazy_DHP_cmpmix()
109 // traits-based version
110 typedef cc::SplitListSet< cds::gc::DHP, item, DHP_cmpmix_traits > set;
113 // option-based version
114 typedef cc::SplitListSet< cds::gc::DHP, 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< opt_set >();
130 void HashSetHdrTest::Split_Lazy_DHP_cmpmix_stat()
132 // traits-based version
133 typedef cc::SplitListSet< cds::gc::DHP, item, DHP_cmpmix_stat_traits > set;
136 // option-based version
137 typedef cc::SplitListSet< cds::gc::DHP, item,
138 cc::split_list::make_traits<
139 cc::split_list::ordered_list<cc::lazy_list_tag>
140 ,cc::opt::hash< hash_int >
141 ,cc::opt::item_counter< simple_item_counter >
142 ,cc::split_list::ordered_list_traits<
143 cc::lazy_list::make_traits<
144 cc::opt::less< less<item> >
145 ,cc::opt::compare< cmp<item> >
148 ,cds::opt::stat< cc::split_list::stat<> >
151 test_int< opt_set >();