3 #include "set/hdr_set.h"
4 #include <cds/urcu/general_buffered.h>
5 #include <cds/container/lazy_list_rcu.h>
6 #include <cds/container/split_list_set_rcu.h>
11 typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
13 struct RCU_GPB_cmp_traits: public cc::split_list::traits
15 typedef cc::lazy_list_tag ordered_list;
16 typedef HashSetHdrTest::hash_int hash;
17 typedef HashSetHdrTest::simple_item_counter item_counter;
18 typedef cc::opt::v::relaxed_ordering memory_model;
19 enum { dynamic_bucket_table = false };
21 struct ordered_list_traits: public cc::lazy_list::traits
23 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
27 struct RCU_GPB_less_traits: public cc::split_list::traits
29 typedef cc::lazy_list_tag ordered_list;
30 typedef HashSetHdrTest::hash_int hash;
31 typedef HashSetHdrTest::simple_item_counter item_counter;
32 typedef cc::opt::v::sequential_consistent memory_model;
33 enum { dynamic_bucket_table = false };
35 struct ordered_list_traits: public cc::lazy_list::traits
37 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
41 struct RCU_cmpmix_traits: public cc::split_list::traits
43 typedef cc::lazy_list_tag ordered_list;
44 typedef HashSetHdrTest::hash_int hash;
45 typedef HashSetHdrTest::simple_item_counter item_counter;
47 struct ordered_list_traits: public cc::lazy_list::traits
49 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
50 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
54 struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
56 typedef cc::split_list::stat<> stat;
60 void HashSetHdrTest::Split_Lazy_RCU_GPB_cmp()
62 // traits-based version
63 typedef cc::SplitListSet< rcu_type, item, RCU_GPB_cmp_traits > set;
65 test_int_rcu< set >();
67 // option-based version
68 typedef cc::SplitListSet< rcu_type, item,
69 cc::split_list::make_traits<
70 cc::split_list::ordered_list<cc::lazy_list_tag>
71 ,cc::opt::hash< hash_int >
72 ,cc::opt::item_counter< simple_item_counter >
73 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
74 ,cc::split_list::dynamic_bucket_table< true >
75 ,cc::split_list::ordered_list_traits<
76 cc::lazy_list::make_traits<
77 cc::opt::compare< cmp<item> >
82 test_int_rcu< opt_set >();
85 void HashSetHdrTest::Split_Lazy_RCU_GPB_less()
87 // traits-based version
88 typedef cc::SplitListSet< rcu_type, item, RCU_GPB_less_traits > set;
90 test_int_rcu< set >();
92 // option-based version
93 typedef cc::SplitListSet< rcu_type, item,
94 cc::split_list::make_traits<
95 cc::split_list::ordered_list<cc::lazy_list_tag>
96 ,cc::opt::hash< hash_int >
97 ,cc::opt::item_counter< simple_item_counter >
98 ,cc::opt::memory_model< cc::opt::v::sequential_consistent >
99 ,cc::split_list::dynamic_bucket_table< false >
100 ,cc::split_list::ordered_list_traits<
101 cc::lazy_list::make_traits<
102 cc::opt::less< less<item> >
107 test_int_rcu< opt_set >();
110 void HashSetHdrTest::Split_Lazy_RCU_GPB_cmpmix()
112 // traits-based version
113 typedef cc::SplitListSet< rcu_type, item, RCU_cmpmix_traits > set;
114 test_int_rcu< set >();
116 // option-based version
117 typedef cc::SplitListSet< rcu_type, item,
118 cc::split_list::make_traits<
119 cc::split_list::ordered_list<cc::lazy_list_tag>
120 ,cc::opt::hash< hash_int >
121 ,cc::opt::item_counter< simple_item_counter >
122 ,cc::split_list::ordered_list_traits<
123 cc::lazy_list::make_traits<
124 cc::opt::less< less<item> >
125 ,cc::opt::compare< cmp<item> >
130 test_int_rcu< opt_set >();
133 void HashSetHdrTest::Split_Lazy_RCU_GPB_cmpmix_stat()
135 // traits-based version
136 typedef cc::SplitListSet< rcu_type, item, RCU_cmpmix_stat_traits > set;
137 test_int_rcu< set >();
139 // option-based version
140 typedef cc::SplitListSet< rcu_type, item,
141 cc::split_list::make_traits<
142 cc::split_list::ordered_list<cc::lazy_list_tag>
143 ,cc::opt::hash< hash_int >
144 ,cc::opt::item_counter< simple_item_counter >
145 ,cc::opt::stat< cc::split_list::stat<>>
146 ,cc::split_list::ordered_list_traits<
147 cc::lazy_list::make_traits<
148 cc::opt::less< less<item> >
149 ,cc::opt::compare< cmp<item> >
154 test_int_rcu< opt_set >();