3 #ifndef CDSUNIT_MAP_TYPE_MULTILEVEL_HASHMAP_H
4 #define CDSUNIT_MAP_TYPE_MULTILEVEL_HASHMAP_H
6 #include "map2/map_type.h"
8 #include <cds/container/multilevel_hashmap_hp.h>
9 #include <cds/container/multilevel_hashmap_dhp.h>
11 #include "print_multilevel_hashset_stat.h"
15 template <class GC, typename Key, typename T, typename Traits = cc::multilevel_hashmap::traits>
16 class MultiLevelHashMap : public cc::MultiLevelHashMap< GC, Key, T, Traits >
18 typedef cc::MultiLevelHashMap< GC, Key, T, Traits > base_class;
20 template <typename Config>
21 MultiLevelHashMap( Config const& cfg)
22 : base_class( cfg.c_nMultiLevelMap_HeadBits, cfg.c_nMultiLevelMap_ArrayBits )
26 static CDS_CONSTEXPR bool const c_bExtractSupported = true;
27 static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
30 struct tag_MultiLevelHashMap;
32 template <typename Key, typename Value>
33 struct map_type< tag_MultiLevelHashMap, Key, Value >: public map_type_base< Key, Value >
35 typedef map_type_base< Key, Value > base_class;
36 typedef typename base_class::compare compare;
37 typedef typename base_class::less less;
39 typedef MultiLevelHashMap< cds::gc::HP, Key, Value > MultiLevelHashMap_hp_stdhash;
40 typedef MultiLevelHashMap< cds::gc::DHP, Key, Value > MultiLevelHashMap_dhp_stdhash;
42 struct traits_MultiLevelHashMap_stat: public cc::multilevel_hashmap::make_traits<
43 co::stat< cc::multilevel_hashmap::stat<>>
47 typedef MultiLevelHashMap< cds::gc::HP, Key, Value, traits_MultiLevelHashMap_stat > MultiLevelHashMap_hp_stdhash_stat;
48 typedef MultiLevelHashMap< cds::gc::DHP, Key, Value, traits_MultiLevelHashMap_stat > MultiLevelHashMap_dhp_stdhash_stat;
51 template <typename GC, typename K, typename T, typename Traits >
52 static inline void print_stat( cc::MultiLevelHashMap< GC, K, T, Traits > const& m )
54 CPPUNIT_MSG( m.statistics() );
59 #endif // #ifndef CDSUNIT_MAP_TYPE_MULTILEVEL_HASHMAP_H