3 #include "map/hdr_map.h"
4 #include <cds/urcu/general_instant.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_instant<> > rcu_type;
13 struct RCU_GPI_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_GPI_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;
61 void HashMapHdrTest::Split_RCU_GPI_cmp()
63 // traits-based version
64 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > map_type;
65 test_rcu_split_list< map_type >();
67 // option-based version
68 typedef cc::SplitListMap< rcu_type,
71 cc::split_list::make_traits<
72 cc::split_list::ordered_list<cc::michael_list_tag>
73 ,cc::opt::hash< hash_int >
74 ,cc::opt::item_counter< simple_item_counter >
75 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
76 ,cc::split_list::dynamic_bucket_table< true >
77 ,cc::split_list::ordered_list_traits<
78 cc::michael_list::make_traits<
79 cc::opt::compare< cmp >
84 test_rcu_split_list< opt_map >();
87 void HashMapHdrTest::Split_RCU_GPI_less()
89 // traits-based version
90 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_less_traits > map_type;
91 test_rcu_split_list< map_type >();
93 // option-based version
94 typedef cc::SplitListMap< rcu_type,
97 cc::split_list::make_traits<
98 cc::split_list::ordered_list<cc::michael_list_tag>
99 ,cc::opt::hash< hash_int >
100 ,cc::opt::item_counter< simple_item_counter >
101 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
102 ,cc::split_list::dynamic_bucket_table< false >
103 ,cc::split_list::ordered_list_traits<
104 cc::michael_list::make_traits<
105 cc::opt::less< less >
110 test_rcu_split_list< opt_map >();
113 void HashMapHdrTest::Split_RCU_GPI_cmpmix()
115 // traits-based version
116 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
117 test_rcu_split_list< map_type >();
119 // option-based version
120 typedef cc::SplitListMap< rcu_type,
123 cc::split_list::make_traits<
124 cc::split_list::ordered_list<cc::michael_list_tag>
125 ,cc::opt::hash< hash_int >
126 ,cc::opt::item_counter< simple_item_counter >
127 ,cc::split_list::ordered_list_traits<
128 cc::michael_list::make_traits<
129 cc::opt::less< std::less<key_type> >
130 ,cc::opt::compare< cmp >
135 test_rcu_split_list< opt_map >();
138 void HashMapHdrTest::Split_RCU_GPI_cmpmix_stat()
140 // traits-based version
141 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
142 test_rcu_split_list< map_type >();
144 // option-based version
145 typedef cc::SplitListMap< rcu_type,
148 cc::split_list::make_traits<
149 cc::split_list::ordered_list<cc::michael_list_tag>
150 ,cc::opt::hash< hash_int >
151 ,cc::opt::item_counter< simple_item_counter >
152 ,cds::opt::stat< cc::split_list::stat<>>
153 ,cc::split_list::ordered_list_traits<
154 cc::michael_list::make_traits<
155 cc::opt::less< std::less<key_type> >
156 ,cc::opt::compare< cmp >
161 test_rcu_split_list< opt_map >();