3 #include "set/hdr_set.h"
4 #include <cds/urcu/general_buffered.h>
5 #include <cds/container/michael_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::type_traits
15 typedef cc::michael_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::michael_list::type_traits
23 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
27 struct RCU_GPB_less_traits: public cc::split_list::type_traits
29 typedef cc::michael_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::michael_list::type_traits
37 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
41 struct RCU_GPB_cmpmix_traits: public cc::split_list::type_traits
43 typedef cc::michael_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::michael_list::type_traits
49 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
50 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
55 void HashSetHdrTest::Split_RCU_GPB_cmp()
57 // traits-based version
58 typedef cc::SplitListSet< rcu_type, item, RCU_GPB_cmp_traits > set;
60 test_int_rcu< set >();
62 // option-based version
63 typedef cc::SplitListSet< rcu_type, item,
64 cc::split_list::make_traits<
65 cc::split_list::ordered_list<cc::michael_list_tag>
66 ,cc::opt::hash< hash_int >
67 ,cc::opt::item_counter< simple_item_counter >
68 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
69 ,cc::split_list::dynamic_bucket_table< true >
70 ,cc::split_list::ordered_list_traits<
71 cc::michael_list::make_traits<
72 cc::opt::compare< cmp<item> >
77 test_int_rcu< opt_set >();
80 void HashSetHdrTest::Split_RCU_GPB_less()
82 // traits-based version
83 typedef cc::SplitListSet< rcu_type, item, RCU_GPB_less_traits > set;
85 test_int_rcu< set >();
87 // option-based version
88 typedef cc::SplitListSet< rcu_type, item,
89 cc::split_list::make_traits<
90 cc::split_list::ordered_list<cc::michael_list_tag>
91 ,cc::opt::hash< hash_int >
92 ,cc::opt::item_counter< simple_item_counter >
93 ,cc::opt::memory_model< cc::opt::v::sequential_consistent >
94 ,cc::split_list::dynamic_bucket_table< false >
95 ,cc::split_list::ordered_list_traits<
96 cc::michael_list::make_traits<
97 cc::opt::less< less<item> >
102 test_int_rcu< opt_set >();
105 void HashSetHdrTest::Split_RCU_GPB_cmpmix()
107 // traits-based version
108 typedef cc::SplitListSet< rcu_type, item, RCU_GPB_cmpmix_traits > set;
109 test_int_rcu< set >();
111 // option-based version
112 typedef cc::SplitListSet< rcu_type, item,
113 cc::split_list::make_traits<
114 cc::split_list::ordered_list<cc::michael_list_tag>
115 ,cc::opt::hash< hash_int >
116 ,cc::opt::item_counter< simple_item_counter >
117 ,cc::split_list::ordered_list_traits<
118 cc::michael_list::make_traits<
119 cc::opt::less< less<item> >
120 ,cc::opt::compare< cmp<item> >
125 test_int_rcu< opt_set >();