3 #include "map/hdr_map.h"
4 #include <cds/urcu/general_buffered.h>
5 #include <cds/container/michael_list_rcu.h>
6 #include <cds/container/split_list_map_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::michael_list_tag ordered_list;
16 typedef HashMapHdrTest::hash_int hash;
17 typedef HashMapHdrTest::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::traits
23 typedef HashMapHdrTest::cmp compare;
27 struct RCU_GPB_less_traits: public cc::split_list::traits
29 typedef cc::michael_list_tag ordered_list;
30 typedef HashMapHdrTest::hash_int hash;
31 typedef HashMapHdrTest::simple_item_counter item_counter;
32 typedef cc::opt::v::sequential_consistent memory_model;
33 enum { dynamic_bucket_table = true };
35 struct ordered_list_traits: public cc::michael_list::traits
37 typedef HashMapHdrTest::less less;
41 struct RCU_cmpmix_traits: public cc::split_list::traits
43 typedef cc::michael_list_tag ordered_list;
44 typedef HashMapHdrTest::hash_int hash;
45 typedef HashMapHdrTest::simple_item_counter item_counter;
47 struct ordered_list_traits: public cc::michael_list::traits
49 typedef HashMapHdrTest::cmp compare;
50 typedef std::less<HashMapHdrTest::key_type> less;
54 struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
56 typedef cc::split_list::stat<> stat;
60 void HashMapHdrTest::Split_RCU_GPB_cmp()
62 // traits-based version
63 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > map_type;
64 test_rcu< map_type >();
66 // option-based version
67 typedef cc::SplitListMap< rcu_type,
70 cc::split_list::make_traits<
71 cc::split_list::ordered_list<cc::michael_list_tag>
72 ,cc::opt::hash< hash_int >
73 ,cc::opt::item_counter< simple_item_counter >
74 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
75 ,cc::split_list::dynamic_bucket_table< true >
76 ,cc::split_list::ordered_list_traits<
77 cc::michael_list::make_traits<
78 cc::opt::compare< cmp >
83 test_rcu< opt_map >();
86 void HashMapHdrTest::Split_RCU_GPB_less()
88 // traits-based version
89 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_less_traits > map_type;
90 test_rcu< map_type >();
92 // option-based version
93 typedef cc::SplitListMap< rcu_type,
96 cc::split_list::make_traits<
97 cc::split_list::ordered_list<cc::michael_list_tag>
98 ,cc::opt::hash< hash_int >
99 ,cc::opt::item_counter< simple_item_counter >
100 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
101 ,cc::split_list::dynamic_bucket_table< false >
102 ,cc::split_list::ordered_list_traits<
103 cc::michael_list::make_traits<
104 cc::opt::less< less >
109 test_rcu< opt_map >();
112 void HashMapHdrTest::Split_RCU_GPB_cmpmix()
114 // traits-based version
115 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
116 test_rcu< map_type >();
118 // option-based version
119 typedef cc::SplitListMap< rcu_type,
122 cc::split_list::make_traits<
123 cc::split_list::ordered_list<cc::michael_list_tag>
124 ,cc::opt::hash< hash_int >
125 ,cc::opt::item_counter< simple_item_counter >
126 ,cc::split_list::ordered_list_traits<
127 cc::michael_list::make_traits<
128 cc::opt::less< std::less<key_type> >
129 ,cc::opt::compare< cmp >
134 test_rcu< opt_map >();
137 void HashMapHdrTest::Split_RCU_GPB_cmpmix_stat()
139 // traits-based version
140 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
141 test_rcu< map_type >();
143 // option-based version
144 typedef cc::SplitListMap< rcu_type,
147 cc::split_list::make_traits<
148 cc::split_list::ordered_list<cc::michael_list_tag>
149 ,cc::opt::hash< hash_int >
150 ,cc::opt::item_counter< simple_item_counter >
151 ,cds::opt::stat< cc::split_list::stat<>>
152 ,cc::split_list::ordered_list_traits<
153 cc::michael_list::make_traits<
154 cc::opt::less< std::less<key_type> >
155 ,cc::opt::compare< cmp >
160 test_rcu< opt_map >();