3 #include "map/hdr_map.h"
4 #include <cds/urcu/general_instant.h>
5 #include <cds/container/michael_kvlist_rcu.h>
6 #include <cds/container/michael_map_rcu.h>
10 struct map_traits: public cc::michael_map::traits
12 typedef HashMapHdrTest::hash_int hash;
13 typedef HashMapHdrTest::simple_item_counter item_counter;
15 typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
17 struct RCU_GPI_cmp_traits: public cc::michael_list::traits
19 typedef HashMapHdrTest::cmp compare;
22 struct RCU_GPI_less_traits: public cc::michael_list::traits
24 typedef HashMapHdrTest::less less;
27 struct RCU_GPI_cmpmix_traits: public cc::michael_list::traits
29 typedef HashMapHdrTest::cmp compare;
30 typedef HashMapHdrTest::less less;
34 void HashMapHdrTest::Michael_RCU_GPI_cmp()
36 typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmp_traits > list;
38 // traits-based version
39 typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
42 // option-based version
43 typedef cc::MichaelHashMap< rcu_type, list,
44 cc::michael_map::make_traits<
45 cc::opt::hash< hash_int >
46 ,cc::opt::item_counter< simple_item_counter >
49 test_rcu< opt_map >();
52 void HashMapHdrTest::Michael_RCU_GPI_less()
54 typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_less_traits > list;
56 // traits-based version
57 typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
60 // option-based version
61 typedef cc::MichaelHashMap< rcu_type, list,
62 cc::michael_map::make_traits<
63 cc::opt::hash< hash_int >
64 ,cc::opt::item_counter< simple_item_counter >
67 test_rcu< opt_map >();
70 void HashMapHdrTest::Michael_RCU_GPI_cmpmix()
72 typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmpmix_traits > list;
74 // traits-based version
75 typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
78 // option-based version
79 typedef cc::MichaelHashMap< rcu_type, list,
80 cc::michael_map::make_traits<
81 cc::opt::hash< hash_int >
82 ,cc::opt::item_counter< simple_item_counter >
85 test_rcu< opt_map >();