7e23eca933d7274854a10a67a14060aef48cfbde
[libcds.git] / test / stress / map / map_type_michael.h
1 /*
2     This file is a part of libcds - Concurrent Data Structures library
3
4     (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
5
6     Source code repo: http://github.com/khizmax/libcds/
7     Download: http://sourceforge.net/projects/libcds/files/
8
9     Redistribution and use in source and binary forms, with or without
10     modification, are permitted provided that the following conditions are met:
11
12     * Redistributions of source code must retain the above copyright notice, this
13       list of conditions and the following disclaimer.
14
15     * Redistributions in binary form must reproduce the above copyright notice,
16       this list of conditions and the following disclaimer in the documentation
17       and/or other materials provided with the distribution.
18
19     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23     FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24     DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef CDSUNIT_MAP_TYPE_MICHAEL_H
32 #define CDSUNIT_MAP_TYPE_MICHAEL_H
33
34 #include "map_type_michael_list.h"
35 #include "map_type_lazy_list.h"
36 #include "map_type_iterable_list.h"
37
38 #include <cds/container/michael_map.h>
39 #include <cds/container/michael_map_rcu.h>
40 #include <cds/container/michael_map_nogc.h>
41
42 namespace map {
43
44     template <class GC, typename List, typename Traits = cc::michael_map::traits>
45     class MichaelHashMap : public cc::MichaelHashMap< GC, List, Traits >
46     {
47         typedef cc::MichaelHashMap< GC, List, Traits > base_class;
48     public:
49         template <typename Config>
50         MichaelHashMap( Config const& cfg)
51             : base_class( cfg.s_nMapSize, cfg.s_nLoadFactor )
52         {}
53
54         template <typename Iterator>
55         typename std::enable_if< std::is_same< Iterator, typename base_class::iterator>::value, Iterator>::type
56         get_begin()
57         {
58             return base_class::begin();
59         }
60
61         template <typename Iterator>
62         typename std::enable_if< std::is_same< Iterator, typename base_class::iterator>::value, Iterator>::type
63         get_end()
64         {
65             return base_class::end();
66         }
67
68         // for testing
69         static CDS_CONSTEXPR bool const c_bExtractSupported = true;
70         static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
71         static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
72     };
73
74     struct tag_MichaelHashMap;
75
76     template <typename Key, typename Value>
77     struct map_type< tag_MichaelHashMap, Key, Value >: public map_type_base< Key, Value >
78     {
79         typedef map_type_base< Key, Value > base_class;
80         typedef typename base_class::key_compare compare;
81         typedef typename base_class::key_less    less;
82         typedef typename base_class::equal_to    equal_to;
83         typedef typename base_class::key_hash    hash;
84
85         struct traits_MichaelMap_hash :
86             public cc::michael_map::make_traits<
87                 co::hash< hash >
88             >::type
89         {};
90
91         // ***************************************************************************
92         // MichaelHashMap based on MichaelKVList
93         typedef michael_list_type< Key, Value > ml;
94
95         typedef MichaelHashMap< cds::gc::HP,  typename ml::MichaelList_HP_cmp,  traits_MichaelMap_hash > MichaelMap_HP_cmp;
96         typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_cmp, traits_MichaelMap_hash > MichaelMap_DHP_cmp;
97         typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_cmp, traits_MichaelMap_hash > MichaelMap_NOGC_cmp;
98         typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp, traits_MichaelMap_hash > MichaelMap_RCU_GPI_cmp;
99         typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp, traits_MichaelMap_hash > MichaelMap_RCU_GPB_cmp;
100         typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp, traits_MichaelMap_hash > MichaelMap_RCU_GPT_cmp;
101 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
102         typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp, traits_MichaelMap_hash > MichaelMap_RCU_SHB_cmp;
103         typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp, traits_MichaelMap_hash > MichaelMap_RCU_SHT_cmp;
104 #endif
105
106         typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_cmp_stat, traits_MichaelMap_hash > MichaelMap_HP_cmp_stat;
107         typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_stat, traits_MichaelMap_hash > MichaelMap_DHP_cmp_stat;
108         typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_cmp_stat, traits_MichaelMap_hash > MichaelMap_NOGC_cmp_stat;
109         typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_stat, traits_MichaelMap_hash > MichaelMap_RCU_GPI_cmp_stat;
110         typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_stat, traits_MichaelMap_hash > MichaelMap_RCU_GPB_cmp_stat;
111         typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_stat, traits_MichaelMap_hash > MichaelMap_RCU_GPT_cmp_stat;
112 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
113         typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_stat, traits_MichaelMap_hash > MichaelMap_RCU_SHB_cmp_stat;
114         typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_stat, traits_MichaelMap_hash > MichaelMap_RCU_SHT_cmp_stat;
115 #endif
116
117         typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_less, traits_MichaelMap_hash > MichaelMap_HP_less;
118         typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_less, traits_MichaelMap_hash > MichaelMap_DHP_less;
119         typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_less, traits_MichaelMap_hash > MichaelMap_NOGC_less;
120         typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_less, traits_MichaelMap_hash > MichaelMap_RCU_GPI_less;
121         typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_less, traits_MichaelMap_hash > MichaelMap_RCU_GPB_less;
122         typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_less, traits_MichaelMap_hash > MichaelMap_RCU_GPT_less;
123 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
124         typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_less, traits_MichaelMap_hash > MichaelMap_RCU_SHB_less;
125         typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_less, traits_MichaelMap_hash > MichaelMap_RCU_SHT_less;
126 #endif
127
128         typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_less_stat, traits_MichaelMap_hash > MichaelMap_HP_less_stat;
129         typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_less_stat, traits_MichaelMap_hash > MichaelMap_DHP_less_stat;
130         typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_less_stat, traits_MichaelMap_hash > MichaelMap_NOGC_less_stat;
131         typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stat, traits_MichaelMap_hash > MichaelMap_RCU_GPI_less_stat;
132         typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stat, traits_MichaelMap_hash > MichaelMap_RCU_GPB_less_stat;
133         typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stat, traits_MichaelMap_hash > MichaelMap_RCU_GPT_less_stat;
134 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
135         typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stat, traits_MichaelMap_hash > MichaelMap_RCU_SHB_less_stat;
136         typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stat, traits_MichaelMap_hash > MichaelMap_RCU_SHT_less_stat;
137 #endif
138
139         typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_HP_cmp_seqcst;
140         typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_DHP_cmp_seqcst;
141         typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_NOGC_cmp_seqcst;
142         typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPI_cmp_seqcst;
143         typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPB_cmp_seqcst;
144         typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPT_cmp_seqcst;
145 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
146         typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHB_cmp_seqcst;
147         typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHT_cmp_seqcst;
148 #endif
149
150         typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_less_seqcst, traits_MichaelMap_hash > MichaelMap_HP_less_seqcst;
151         typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_less_seqcst, traits_MichaelMap_hash > MichaelMap_DHP_less_seqcst;
152         typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_less_seqcst, traits_MichaelMap_hash > MichaelMap_NOGC_less_seqcst;
153         typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPI_less_seqcst;
154         typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPB_less_seqcst;
155         typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPT_less_seqcst;
156 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
157         typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_less_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHB_less_seqcst;
158         typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_less_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHT_less_seqcst;
159 #endif
160
161
162         // ***************************************************************************
163         // MichaelHashMap based on LazyKVList
164         typedef lazy_list_type< Key, Value > ll;
165
166         typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_HP_cmp;
167         typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_cmp;
168         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_cmp;
169         typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_cmp;
170         typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_cmp;
171         typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_cmp;
172 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
173         typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_cmp;
174         typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_cmp, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_cmp;
175 #endif
176
177         typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_HP_cmp_stat;
178         typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_cmp_stat;
179         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_cmp_stat;
180         typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_cmp_stat;
181         typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_cmp_stat;
182         typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_cmp_stat;
183 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
184         typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_cmp_stat;
185         typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_cmp_stat;
186 #endif
187
188         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_unord, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_unord;
189
190         typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_less, traits_MichaelMap_hash > MichaelMap_Lazy_HP_less;
191         typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_less, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_less;
192         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_less, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_less;
193         typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_less, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_less;
194         typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_less, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_less;
195         typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_less, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_less;
196 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
197         typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_less, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_less;
198         typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_less, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_less;
199 #endif
200
201         typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_HP_less_stat;
202         typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_less_stat;
203         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_less_stat;
204         typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_less_stat;
205         typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_less_stat;
206         typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_less_stat;
207 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
208         typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_less_stat;
209         typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_less_stat, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_less_stat;
210 #endif
211
212         typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_HP_cmp_seqcst;
213         typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_cmp_seqcst;
214         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_cmp_seqcst;
215         typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_cmp_seqcst;
216         typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_cmp_seqcst;
217         typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_cmp_seqcst;
218 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
219         typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_cmp_seqcst;
220         typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_cmp_seqcst;
221 #endif
222
223         typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_HP_less_seqcst;
224         typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_less_seqcst;
225         typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_less_seqcst;
226         typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_less_seqcst;
227         typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_less_seqcst;
228         typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_less_seqcst;
229 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
230         typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_less_seqcst;
231         typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_less_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_less_seqcst;
232 #endif
233
234
235         // ***************************************************************************
236         // MichaelHashMap based on IterableKVList
237         typedef iterable_list_type< Key, Value > il;
238
239         typedef MichaelHashMap< cds::gc::HP,  typename il::IterableList_HP_cmp,  traits_MichaelMap_hash > MichaelMap_Iterable_HP_cmp;
240         typedef MichaelHashMap< cds::gc::DHP, typename il::IterableList_DHP_cmp, traits_MichaelMap_hash > MichaelMap_Iterable_DHP_cmp;
241
242         typedef MichaelHashMap< cds::gc::HP, typename il::IterableList_HP_cmp_stat, traits_MichaelMap_hash > MichaelMap_Iterable_HP_cmp_stat;
243         typedef MichaelHashMap< cds::gc::DHP, typename il::IterableList_DHP_cmp_stat, traits_MichaelMap_hash > MichaelMap_Iterable_DHP_cmp_stat;
244
245         typedef MichaelHashMap< cds::gc::HP, typename il::IterableList_HP_less, traits_MichaelMap_hash > MichaelMap_Iterable_HP_less;
246         typedef MichaelHashMap< cds::gc::DHP, typename il::IterableList_DHP_less, traits_MichaelMap_hash > MichaelMap_Iterable_DHP_less;
247
248         typedef MichaelHashMap< cds::gc::HP, typename il::IterableList_HP_less_stat, traits_MichaelMap_hash > MichaelMap_Iterable_HP_less_stat;
249         typedef MichaelHashMap< cds::gc::DHP, typename il::IterableList_DHP_less_stat, traits_MichaelMap_hash > MichaelMap_Iterable_DHP_less_stat;
250
251         typedef MichaelHashMap< cds::gc::HP, typename il::IterableList_HP_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Iterable_HP_cmp_seqcst;
252         typedef MichaelHashMap< cds::gc::DHP, typename il::IterableList_DHP_cmp_seqcst, traits_MichaelMap_hash > MichaelMap_Iterable_DHP_cmp_seqcst;
253
254     };
255 }   // namespace map
256
257 #define CDSSTRESS_MichaelMap_case( fixture, test_case, michael_map_type, key_type, value_type ) \
258     TEST_P( fixture, michael_map_type ) \
259     { \
260         typedef map::map_type< tag_MichaelHashMap, key_type, value_type >::michael_map_type map_type; \
261         test_case<map_type>(); \
262     }
263
264 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
265
266 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL > 1
267 #   define CDSSTRESS_MichaelMap_SHRCU_2( fixture, test_case, key_type, value_type ) \
268         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHB_cmp_seqcst,       key_type, value_type ) \
269         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHT_cmp_seqcst,       key_type, value_type ) \
270         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHB_less_seqcst,      key_type, value_type ) \
271         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHT_less_seqcst,      key_type, value_type ) \
272         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHB_cmp_seqcst,  key_type, value_type ) \
273         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHT_cmp_seqcst,  key_type, value_type ) \
274         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHB_less_seqcst, key_type, value_type ) \
275         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHT_less_seqcst, key_type, value_type ) \
276
277 #else
278 #   define CDSSTRESS_MichaelMap_SHRCU_2( fixture, test_case, key_type, value_type )
279 #endif
280
281 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL == 1
282 #   define CDSSTRESS_MichaelMap_SHRCU_1( fixture, test_case, key_type, value_type ) \
283         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHT_cmp,              key_type, value_type ) \
284         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHB_less,             key_type, value_type ) \
285         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHT_cmp,         key_type, value_type ) \
286         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHB_less,        key_type, value_type ) \
287
288 #else
289 #   define CDSSTRESS_MichaelMap_SHRCU_1( fixture, test_case, key_type, value_type )
290 #endif
291
292 #   define CDSSTRESS_MichaelMap_SHRCU( fixture, test_case, key_type, value_type ) \
293         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHB_cmp,              key_type, value_type ) \
294         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_SHT_less,             key_type, value_type ) \
295         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHB_cmp,         key_type, value_type ) \
296         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_SHT_less,        key_type, value_type ) \
297         CDSSTRESS_MichaelMap_SHRCU_1( fixture, test_case, key_type, value_type ) \
298         CDSSTRESS_MichaelMap_SHRCU_2( fixture, test_case, key_type, value_type ) \
299
300 #else
301 #   define CDSSTRESS_MichaelMap_SHRCU( fixture, test_case, key_type, value_type )
302 #endif
303
304 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL > 1
305 #   define  CDSSTRESS_MichaelMap_HP_2( fixture, test_case, key_type, value_type ) \
306         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_HP_cmp_seqcst,               key_type, value_type ) \
307         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_DHP_cmp_seqcst,              key_type, value_type ) \
308         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_HP_less_seqcst,              key_type, value_type ) \
309         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_DHP_less_seqcst,             key_type, value_type ) \
310         \
311         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_HP_cmp_seqcst,          key_type, value_type ) \
312         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_DHP_cmp_seqcst,         key_type, value_type ) \
313         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_HP_less_seqcst,         key_type, value_type ) \
314         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_DHP_less_seqcst,        key_type, value_type ) \
315         \
316         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_HP_cmp_seqcst,      key_type, value_type ) \
317         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_DHP_cmp_seqcst,     key_type, value_type ) \
318
319 #   define  CDSSTRESS_MichaelMap_RCU_2( fixture, test_case, key_type, value_type ) \
320         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPI_cmp_seqcst,          key_type, value_type ) \
321         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPB_cmp_seqcst,          key_type, value_type ) \
322         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPT_cmp_seqcst,          key_type, value_type ) \
323         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPI_less_seqcst,         key_type, value_type ) \
324         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPB_less_seqcst,         key_type, value_type ) \
325         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPT_less_seqcst,         key_type, value_type ) \
326         \
327         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPI_cmp_seqcst,     key_type, value_type ) \
328         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPB_cmp_seqcst,     key_type, value_type ) \
329         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPT_cmp_seqcst,     key_type, value_type ) \
330         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPI_less_seqcst,    key_type, value_type ) \
331         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPB_less_seqcst,    key_type, value_type ) \
332         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPT_less_seqcst,    key_type, value_type ) \
333
334 #   define  CDSSTRESS_MichaelMap_2( fixture, test_case, key_type, value_type ) \
335         CDSSTRESS_MichaelMap_HP_2( fixture, test_case, key_type, value_type ) \
336         CDSSTRESS_MichaelMap_RCU_2( fixture, test_case, key_type, value_type ) \
337
338 #else
339 #   define  CDSSTRESS_MichaelMap_HP_2( fixture, test_case, key_type, value_type )
340 #   define  CDSSTRESS_MichaelMap_RCU_2( fixture, test_case, key_type, value_type )
341 #   define  CDSSTRESS_MichaelMap_2( fixture, test_case, key_type, value_type )
342 #endif
343
344 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL == 1
345
346 #   define CDSSTRESS_MichaelMap_Iterable_1( fixture, test_case, key_type, value_type ) \
347         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_DHP_cmp,            key_type, value_type ) \
348         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_HP_cmp_stat,        key_type, value_type ) \
349         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_HP_less,            key_type, value_type ) \
350         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_DHP_less_stat,      key_type, value_type ) \
351
352 #   define CDSSTRESS_MichaelMap_HP_1( fixture, test_case, key_type, value_type ) \
353         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_DHP_cmp,                     key_type, value_type ) \
354         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_HP_cmp_stat,                 key_type, value_type ) \
355         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_HP_less,                     key_type, value_type ) \
356         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_DHP_less_stat,               key_type, value_type ) \
357         \
358         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_DHP_cmp,                key_type, value_type ) \
359         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_HP_cmp_stat,            key_type, value_type ) \
360         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_HP_less,                key_type, value_type ) \
361         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_DHP_less_stat,          key_type, value_type ) \
362
363 #   define  CDSSTRESS_MichaelMap_RCU_1( fixture, test_case, key_type, value_type ) \
364         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPB_cmp,                 key_type, value_type ) \
365         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPI_less,                key_type, value_type ) \
366         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPT_less,                key_type, value_type ) \
367         \
368         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPB_cmp,            key_type, value_type ) \
369         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPI_less,           key_type, value_type ) \
370         CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPT_less,           key_type, value_type ) \
371         \
372         CDSSTRESS_MichaelMap_SHRCU( fixture, test_case, key_type, value_type ) \
373
374 #   define  CDSSTRESS_MichaelMap_1( fixture, test_case, key_type, value_type ) \
375         CDSSTRESS_MichaelMap_HP_1( fixture, test_case, key_type, value_type ) \
376         CDSSTRESS_MichaelMap_RCU_1( fixture, test_case, key_type, value_type ) \
377
378 #else
379 #   define CDSSTRESS_MichaelMap_Iterable_1( fixture, test_case, key_type, value_type )
380 #   define  CDSSTRESS_MichaelMap_HP_1( fixture, test_case, key_type, value_type )
381 #   define  CDSSTRESS_MichaelMap_RCU_1( fixture, test_case, key_type, value_type )
382 #   define  CDSSTRESS_MichaelMap_1( fixture, test_case, key_type, value_type )
383 #endif
384
385 #define CDSSTRESS_MichaelMap_Iterable( fixture, test_case, key_type, value_type ) \
386     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_HP_cmp,             key_type, value_type ) \
387     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_DHP_cmp_stat,       key_type, value_type ) \
388     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_DHP_less,           key_type, value_type ) \
389     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Iterable_HP_less_stat,       key_type, value_type ) \
390     CDSSTRESS_MichaelMap_Iterable_1( fixture, test_case, key_type, value_type ) \
391
392 #define CDSSTRESS_MichaelMap_HP( fixture, test_case, key_type, value_type ) \
393     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_HP_cmp,                      key_type, value_type ) \
394     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_DHP_cmp_stat,                key_type, value_type ) \
395     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_DHP_less,                    key_type, value_type ) \
396     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_HP_less_stat,                key_type, value_type ) \
397     \
398     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_HP_cmp,                 key_type, value_type ) \
399     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_DHP_cmp_stat,           key_type, value_type ) \
400     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_DHP_less,               key_type, value_type ) \
401     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_HP_less_stat,           key_type, value_type ) \
402     \
403     CDSSTRESS_MichaelMap_Iterable( fixture, test_case, key_type, value_type ) \
404     CDSSTRESS_MichaelMap_HP_1( fixture, test_case, key_type, value_type ) \
405     CDSSTRESS_MichaelMap_HP_2( fixture, test_case, key_type, value_type ) \
406
407
408 #define CDSSTRESS_MichaelMap_RCU( fixture, test_case, key_type, value_type ) \
409     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPI_cmp,                 key_type, value_type ) \
410     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPT_cmp,                 key_type, value_type ) \
411     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_RCU_GPB_less,                key_type, value_type ) \
412     \
413     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPI_cmp,            key_type, value_type ) \
414     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPT_cmp,            key_type, value_type ) \
415     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_RCU_GPB_less,           key_type, value_type ) \
416     \
417     CDSSTRESS_MichaelMap_RCU_1( fixture, test_case, key_type, value_type ) \
418     CDSSTRESS_MichaelMap_RCU_2( fixture, test_case, key_type, value_type ) \
419
420 #define CDSSTRESS_MichaelMap( fixture, test_case, key_type, value_type ) \
421     CDSSTRESS_MichaelMap_HP( fixture, test_case, key_type, value_type ) \
422     CDSSTRESS_MichaelMap_RCU( fixture, test_case, key_type, value_type ) \
423
424 #define CDSSTRESS_MichaelMap_nogc( fixture, test_case, key_type, value_type ) \
425     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_NOGC_cmp,                    key_type, value_type ) \
426     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_NOGC_less,                   key_type, value_type ) \
427     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_NOGC_cmp,               key_type, value_type ) \
428     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_NOGC_unord,             key_type, value_type ) \
429     CDSSTRESS_MichaelMap_case( fixture, test_case, MichaelMap_Lazy_NOGC_less,              key_type, value_type ) \
430
431
432 #endif // ifndef CDSUNIT_MAP_TYPE_MICHAEL_H