3 #include "map/hdr_map.h"
4 #include <cds/container/lazy_list_hp.h>
5 #include <cds/container/split_list_map.h>
10 struct HP_cmp_traits: public cc::split_list::traits
12 typedef cc::lazy_list_tag ordered_list;
13 typedef HashMapHdrTest::hash_int hash;
14 typedef HashMapHdrTest::simple_item_counter item_counter;
15 typedef cc::opt::v::relaxed_ordering memory_model;
16 enum { dynamic_bucket_table = false };
18 struct ordered_list_traits: public cc::lazy_list::traits
20 typedef HashMapHdrTest::cmp compare;
24 struct HP_less_traits: public cc::split_list::traits
26 typedef cc::lazy_list_tag ordered_list;
27 typedef HashMapHdrTest::hash_int hash;
28 typedef HashMapHdrTest::simple_item_counter item_counter;
29 typedef cc::opt::v::sequential_consistent memory_model;
30 enum { dynamic_bucket_table = false };
32 struct ordered_list_traits: public cc::lazy_list::traits
34 typedef HashMapHdrTest::less less;
38 struct HP_cmpmix_traits: public cc::split_list::traits
40 typedef cc::lazy_list_tag ordered_list;
41 typedef HashMapHdrTest::hash_int hash;
42 typedef HashMapHdrTest::simple_item_counter item_counter;
44 struct ordered_list_traits: public cc::lazy_list::traits
46 typedef HashMapHdrTest::cmp compare;
47 typedef std::less<HashMapHdrTest::key_type> less;
51 struct HP_cmpmix_stat_traits : public HP_cmpmix_traits
53 typedef cc::split_list::stat<> stat;
57 void HashMapHdrTest::Split_Lazy_HP_cmp()
59 // traits-based version
60 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type;
61 test_int< map_type >();
63 // option-based version
64 typedef cc::SplitListMap< cds::gc::HP,
67 cc::split_list::make_traits<
68 cc::split_list::ordered_list<cc::lazy_list_tag>
69 ,cc::opt::hash< hash_int >
70 ,cc::opt::item_counter< simple_item_counter >
71 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
72 ,cc::split_list::dynamic_bucket_table< true >
73 ,cc::split_list::ordered_list_traits<
74 cc::lazy_list::make_traits<
75 cc::opt::compare< cmp >
80 test_int< opt_map >();
83 void HashMapHdrTest::Split_Lazy_HP_less()
85 // traits-based version
86 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type;
87 test_int< map_type >();
89 // option-based version
90 typedef cc::SplitListMap< cds::gc::HP,
93 cc::split_list::make_traits<
94 cc::split_list::ordered_list<cc::lazy_list_tag>
95 ,cc::opt::hash< hash_int >
96 ,cc::opt::item_counter< simple_item_counter >
97 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
98 ,cc::split_list::dynamic_bucket_table< true >
99 ,cc::split_list::ordered_list_traits<
100 cc::lazy_list::make_traits<
101 cc::opt::less< less >
106 test_int< opt_map >();
109 void HashMapHdrTest::Split_Lazy_HP_cmpmix()
111 // traits-based version
112 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type;
113 test_int< map_type >();
115 // option-based version
116 typedef cc::SplitListMap< cds::gc::HP,
119 cc::split_list::make_traits<
120 cc::split_list::ordered_list<cc::lazy_list_tag>
121 ,cc::opt::hash< hash_int >
122 ,cc::opt::item_counter< simple_item_counter >
123 ,cc::split_list::ordered_list_traits<
124 cc::lazy_list::make_traits<
125 cc::opt::less< std::less<key_type> >
126 ,cc::opt::compare< cmp >
131 test_int< opt_map >();
134 void HashMapHdrTest::Split_Lazy_HP_cmpmix_stat()
136 // traits-based version
137 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_stat_traits > map_type;
138 test_int< map_type >();
140 // option-based version
141 typedef cc::SplitListMap< cds::gc::HP,
144 cc::split_list::make_traits<
145 cc::split_list::ordered_list<cc::lazy_list_tag>
146 ,cc::opt::hash< hash_int >
147 ,cc::opt::item_counter< simple_item_counter >
148 ,cc::split_list::ordered_list_traits<
149 cc::lazy_list::make_traits<
150 cc::opt::less< std::less<key_type> >
151 ,cc::opt::compare< cmp >
154 ,cc::opt::stat< cc::split_list::stat<>>
157 test_int< opt_map >();