3 #include "map/hdr_map.h"
4 #include <cds/urcu/general_threaded.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_threaded<> > rcu_type;
13 struct RCU_GPT_cmp_traits: public cc::split_list::type_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::type_traits
23 typedef HashMapHdrTest::cmp compare;
27 struct RCU_GPT_less_traits: public cc::split_list::type_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::type_traits
37 typedef HashMapHdrTest::less less;
41 struct RCU_GPT_cmpmix_traits: public cc::split_list::type_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::type_traits
49 typedef HashMapHdrTest::cmp compare;
50 typedef std::less<HashMapHdrTest::key_type> less;
55 void HashMapHdrTest::Split_RCU_GPT_cmp()
57 // traits-based version
58 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > map_type;
59 test_rcu< map_type >();
61 // option-based version
62 typedef cc::SplitListMap< rcu_type,
65 cc::split_list::make_traits<
66 cc::split_list::ordered_list<cc::michael_list_tag>
67 ,cc::opt::hash< hash_int >
68 ,cc::opt::item_counter< simple_item_counter >
69 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
70 ,cc::split_list::dynamic_bucket_table< true >
71 ,cc::split_list::ordered_list_traits<
72 cc::michael_list::make_traits<
73 cc::opt::compare< cmp >
78 test_rcu< opt_map >();
81 void HashMapHdrTest::Split_RCU_GPT_less()
83 // traits-based version
84 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_less_traits > map_type;
85 test_rcu< map_type >();
87 // option-based version
88 typedef cc::SplitListMap< rcu_type,
91 cc::split_list::make_traits<
92 cc::split_list::ordered_list<cc::michael_list_tag>
93 ,cc::opt::hash< hash_int >
94 ,cc::opt::item_counter< simple_item_counter >
95 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
96 ,cc::split_list::dynamic_bucket_table< false >
97 ,cc::split_list::ordered_list_traits<
98 cc::michael_list::make_traits<
104 test_rcu< opt_map >();
107 void HashMapHdrTest::Split_RCU_GPT_cmpmix()
109 // traits-based version
110 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_cmpmix_traits > map_type;
111 test_rcu< map_type >();
113 // option-based version
114 typedef cc::SplitListMap< rcu_type,
117 cc::split_list::make_traits<
118 cc::split_list::ordered_list<cc::michael_list_tag>
119 ,cc::opt::hash< hash_int >
120 ,cc::opt::item_counter< simple_item_counter >
121 ,cc::split_list::ordered_list_traits<
122 cc::michael_list::make_traits<
123 cc::opt::less< std::less<key_type> >
124 ,cc::opt::compare< cmp >
129 test_rcu< opt_map >();