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;
28 static CDS_CONSTEXPR bool const c_erase_with_supported = false;
29 static CDS_CONSTEXPR bool const c_extract_with_supported = false;
32 struct tag_MultiLevelHashMap;
34 template <typename Key, typename Value>
35 struct map_type< map2::tag_MultiLevelHashMap, Key, Value >: public map_type_base< Key, Value >
37 typedef map_type_base< Key, Value > base_class;
38 typedef typename base_class::compare compare;
39 typedef typename base_class::less less;
41 typedef MultiLevelHashMap< cds::gc::HP, Key, Value > MultiLevelHashMap_hp_stdhash;
42 typedef MultiLevelHashMap< cds::gc::DHP, Key, Value > MultiLevelHashMap_dhp_stdhash;
44 struct traits_MultiLevelHashMap_stat: public cc::multilevel_hashmap::make_traits<
45 co::stat< cc::multilevel_hashmap::stat<>>
49 typedef MultiLevelHashMap< cds::gc::HP, Key, Value, traits_MultiLevelHashMap_stat > MultiLevelHashMap_hp_stdhash_stat;
50 typedef MultiLevelHashMap< cds::gc::DHP, Key, Value, traits_MultiLevelHashMap_stat > MultiLevelHashMap_dhp_stdhash_stat;
53 template <typename GC, typename K, typename T, typename Traits >
54 static inline void print_stat( cc::MultiLevelHashMap< GC, K, T, Traits > const& m )
56 CPPUNIT_MSG( m.statistics() );
61 #endif // #ifndef CDSUNIT_MAP_TYPE_MULTILEVEL_HASHMAP_H