3 #include "map/hdr_map.h"
4 #include <cds/container/lazy_kvlist_nogc.h>
5 #include <cds/container/michael_map_nogc.h>
9 struct map_traits: public cc::michael_map::type_traits
11 typedef HashMapHdrTest::hash_int hash;
12 typedef HashMapHdrTest::simple_item_counter item_counter;
14 struct nogc_cmp_traits: public cc::lazy_list::type_traits
16 typedef HashMapHdrTest::cmp compare;
19 struct nogc_less_traits: public cc::lazy_list::type_traits
21 typedef HashMapHdrTest::less less;
24 struct nogc_cmpmix_traits: public cc::lazy_list::type_traits
26 typedef HashMapHdrTest::cmp compare;
27 typedef HashMapHdrTest::less less;
31 void HashMapHdrTest::Lazy_nogc_cmp()
33 typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmp_traits > list;
35 // traits-based version
36 typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
37 test_int_nogc< map >();
39 // option-based version
40 typedef cc::MichaelHashMap< cds::gc::nogc, list,
41 cc::michael_map::make_traits<
42 cc::opt::hash< hash_int >
43 ,cc::opt::item_counter< simple_item_counter >
46 test_int_nogc< opt_map >();
49 void HashMapHdrTest::Lazy_nogc_less()
51 typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_less_traits > list;
53 // traits-based version
54 typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
55 test_int_nogc< map >();
57 // option-based version
58 typedef cc::MichaelHashMap< cds::gc::nogc, list,
59 cc::michael_map::make_traits<
60 cc::opt::hash< hash_int >
61 ,cc::opt::item_counter< simple_item_counter >
64 test_int_nogc< opt_map >();
67 void HashMapHdrTest::Lazy_nogc_cmpmix()
69 typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmpmix_traits > list;
71 // traits-based version
72 typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
73 test_int_nogc< map >();
75 // option-based version
76 typedef cc::MichaelHashMap< cds::gc::nogc, list,
77 cc::michael_map::make_traits<
78 cc::opt::hash< hash_int >
79 ,cc::opt::item_counter< simple_item_counter >
82 test_int_nogc< opt_map >();