From 5840332656969ca02dfee692052e9f5f35242777 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 10 Nov 2014 17:21:58 +0300 Subject: [PATCH] Normalized CuckooSet/Map declaration in test's map_types.h and set_types.h --- tests/unit/map2/map_types.h | 328 +++++++++++++---------------------- tests/unit/set2/set_types.h | 330 +++++++++++++----------------------- 2 files changed, 229 insertions(+), 429 deletions(-) diff --git a/tests/unit/map2/map_types.h b/tests/unit/map2/map_types.h index 4075be1f..58f8f4ab 100644 --- a/tests/unit/map2/map_types.h +++ b/tests/unit/map2/map_types.h @@ -114,54 +114,15 @@ namespace map2 { } }; - template - class CuckooStripedMap: - public cc::CuckooMap< K, V, - typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,Options... - >::type - > - { - public: - typedef typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,Options... - >::type cuckoo_traits; - - typedef cc::CuckooMap< K, V, cuckoo_traits > cuckoo_base_class; - - public: - CuckooStripedMap( size_t nCapacity, size_t nLoadFactor ) - : cuckoo_base_class( nCapacity / (nLoadFactor * 16), (unsigned int) 4 ) - {} - - template - bool erase_with( Q const& key, Pred pred ) - { - return cuckoo_base_class::erase_with( key, typename std::conditional< cuckoo_base_class::c_isSorted, Pred, typename Pred::equal_to>::type() ); - } - }; - - template - class CuckooRefinableMap: - public cc::CuckooMap< K, V, - typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,Options... - >::type - > + template + class CuckooMap : + public cc::CuckooMap< K, V, Traits > { public: - typedef typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,Options... - >::type cuckoo_traits; - - typedef cc::CuckooMap< K, V, cuckoo_traits > cuckoo_base_class; + typedef cc::CuckooMap< K, V, Traits > cuckoo_base_class; public: - CuckooRefinableMap( size_t nCapacity, size_t nLoadFactor ) + CuckooMap( size_t nCapacity, size_t nLoadFactor ) : cuckoo_base_class( nCapacity / (nLoadFactor * 16), (unsigned int) 4 ) {} @@ -1324,165 +1285,112 @@ namespace map2 { // *************************************************************************** // CuckooMap - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedMap_list_unord; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedMap_list_unord_stat; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedMap_list_unord_storehash; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedMap_list_ord; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedMap_list_ord_stat; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedMap_list_ord_storehash; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedMap_vector_unord; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedMap_vector_unord_stat; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedMap_vector_unord_storehash; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedMap_vector_ord; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedMap_vector_ord_stat; - - typedef CuckooStripedMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedMap_vector_ord_storehash; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableMap_list_unord; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableMap_list_unord_stat; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableMap_list_unord_storehash; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableMap_list_ord; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableMap_list_ord_stat; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableMap_list_ord_storehash; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableMap_vector_unord; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableMap_vector_unord_stat; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableMap_vector_unord_storehash; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableMap_vector_ord; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableMap_vector_ord_stat; - - typedef CuckooRefinableMap< Key, Value, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableMap_vector_ord_storehash; + template + struct traits_CuckooStripedMap: public Traits + { + typedef cc::cuckoo::striping<> mutex_policy; + }; + template + struct traits_CuckooRefinableMap : public Traits + { + typedef cc::cuckoo::refinable<> mutex_policy; + }; + + struct traits_CuckooMap_list_unord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::list > + , co::equal_to< equal_to > + , co::hash< std::tuple< hash, hash2 > > + > ::type + {}; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_unord; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_unord; + + struct traits_CuckooMap_list_unord_stat : public traits_CuckooMap_list_unord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_unord_stat; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_unord_stat; + + struct traits_CuckooMap_list_unord_storehash : public traits_CuckooMap_list_unord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_unord_storehash; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_unord_storehash; + + struct traits_CuckooMap_list_ord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::list > + , co::compare< compare > + , co::hash< std::tuple< hash, hash2 > > + >::type + {}; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_ord; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_ord; + + struct traits_CuckooMap_list_ord_stat : public traits_CuckooMap_list_ord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_ord_stat; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_ord_stat; + + struct traits_CuckooMap_list_ord_storehash : public traits_CuckooMap_list_ord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_ord_storehash; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_ord_storehash; + + struct traits_CuckooMap_vector_unord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > + , co::equal_to< equal_to > + , co::hash< std::tuple< hash, hash2 > > + >::type + {}; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_unord; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_unord; + + struct traits_CuckooMap_vector_unord_stat : public traits_CuckooMap_vector_unord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_unord_stat; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_unord_stat; + + struct traits_CuckooMap_vector_unord_storehash : public traits_CuckooMap_vector_unord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_unord_storehash; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_unord_storehash; + + struct traits_CuckooMap_vector_ord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > + , co::compare< compare > + , co::hash< std::tuple< hash, hash2 > > + >::type + {}; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_ord; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_ord; + + struct traits_CuckooMap_vector_ord_stat : public traits_CuckooMap_vector_ord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_ord_stat; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_ord_stat; + + struct traits_CuckooMap_vector_ord_storehash : public traits_CuckooMap_vector_ord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_ord_storehash; + typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_ord_storehash; // *************************************************************************** // SkipListMap @@ -1872,20 +1780,12 @@ namespace map2 { } - template - static inline void print_stat( CuckooStripedMap< K, V, Options... > const& m ) + template + static inline void print_stat( CuckooMap< K, V, Traits > const& m ) { - typedef CuckooStripedMap< K, V, Options... > map_type; + typedef CuckooMap< K, V, Traits > map_type; print_stat( static_cast(m) ); } - - template - static inline void print_stat( CuckooRefinableMap< K, V, Options... > const& m ) - { - typedef CuckooRefinableMap< K, V, Options... > map_type; - print_stat( static_cast(m) ); - } - } // namespace map2 #endif // ifndef _CDSUNIT_MAP2_MAP_TYPES_H diff --git a/tests/unit/set2/set_types.h b/tests/unit/set2/set_types.h index 8c3d09c6..d1e2aee4 100644 --- a/tests/unit/set2/set_types.h +++ b/tests/unit/set2/set_types.h @@ -75,55 +75,15 @@ namespace set2 { typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_sht; #endif - template - class CuckooStripedSet: - public cc::CuckooSet< V, - typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,Options... - >::type - > + template + class CuckooSet : public cc::CuckooSet< V, Traits > { public: - typedef typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,Options... - >::type cuckoo_traits; - - typedef cc::CuckooSet< V, cuckoo_traits > cuckoo_base_class; + typedef cc::CuckooSet< V, Traits > cuckoo_base_class; public: - CuckooStripedSet( size_t nCapacity, size_t nLoadFactor ) - : cuckoo_base_class( nCapacity / (nLoadFactor * 16), (unsigned int) 4 ) - {} - - template - bool erase_with( Q const& key, Pred pred ) - { - return cuckoo_base_class::erase_with( key, typename std::conditional< cuckoo_base_class::c_isSorted, Pred, typename Pred::equal_to>::type() ); - } - }; - - template - class CuckooRefinableSet: - public cc::CuckooSet< V, - typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,Options... - >::type - > - { - public: - typedef typename cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,Options... - >::type cuckoo_traits; - - typedef cc::CuckooSet< V, cuckoo_traits > cuckoo_base_class; - - public: - CuckooRefinableSet( size_t nCapacity, size_t nLoadFactor ) - : cuckoo_base_class( nCapacity / (nLoadFactor * 16), (unsigned int) 4 ) + CuckooSet( size_t nCapacity, size_t nLoadFactor ) + : cuckoo_base_class( nCapacity / (nLoadFactor * 16), (unsigned int)4 ) {} template @@ -1285,165 +1245,113 @@ namespace set2 { // *************************************************************************** // CuckooSet - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedSet_list_unord; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedSet_list_unord_stat; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedSet_list_unord_storehash; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedSet_list_ord; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedSet_list_ord_stat; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedSet_list_ord_storehash; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedSet_vector_unord; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedSet_vector_unord_stat; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedSet_vector_unord_storehash; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooStripedSet_vector_ord; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooStripedSet_vector_ord_stat; - - typedef CuckooStripedSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooStripedSet_vector_ord_storehash; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableSet_list_unord; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableSet_list_unord_stat; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableSet_list_unord_storehash; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableSet_list_ord; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableSet_list_ord_stat; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableSet_list_ord_storehash; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableSet_vector_unord; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableSet_vector_unord_stat; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::equal_to< equal_to > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableSet_vector_unord_storehash; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - > CuckooRefinableSet_vector_ord; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,co::stat< cc::cuckoo::stat > - > CuckooRefinableSet_vector_ord_stat; - - typedef CuckooRefinableSet< key_val, - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::compare< compare > - ,co::hash< std::tuple< hash, hash2 > > - ,cc::cuckoo::store_hash< true > - > CuckooRefinableSet_vector_ord_storehash; + template + struct traits_CuckooStripedSet : public Traits + { + typedef cc::cuckoo::striping<> mutex_policy; + }; + template + struct traits_CuckooRefinableSet : public Traits + { + typedef cc::cuckoo::refinable<> mutex_policy; + }; + + struct traits_CuckooSet_list_unord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::list > + , co::equal_to< equal_to > + , co::hash< std::tuple< hash, hash2 > > + > ::type + {}; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_unord; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_unord; + + struct traits_CuckooSet_list_unord_stat : public traits_CuckooSet_list_unord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_unord_stat; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_unord_stat; + + struct traits_CuckooSet_list_unord_storehash : public traits_CuckooSet_list_unord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_unord_storehash; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_unord_storehash; + + struct traits_CuckooSet_list_ord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::list > + , co::compare< compare > + , co::hash< std::tuple< hash, hash2 > > + > ::type + {}; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_ord; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_ord; + + struct traits_CuckooSet_list_ord_stat : public traits_CuckooSet_list_ord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_ord_stat; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_ord_stat; + + struct traits_CuckooSet_list_ord_storehash : public traits_CuckooSet_list_ord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_ord_storehash; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_ord_storehash; + + + struct traits_CuckooSet_vector_unord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > + , co::equal_to< equal_to > + , co::hash< std::tuple< hash, hash2 > > + > ::type + {}; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_unord; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_unord; + + struct traits_CuckooSet_vector_unord_stat : public traits_CuckooSet_vector_unord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_unord_stat; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_unord_stat; + + struct traits_CuckooSet_vector_unord_storehash : public traits_CuckooSet_vector_unord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_unord_storehash; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_unord_storehash; + + struct traits_CuckooSet_vector_ord : + public cc::cuckoo::make_traits < + cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > + , co::compare< compare > + , co::hash< std::tuple< hash, hash2 > > + > ::type + {}; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_ord; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_ord; + + struct traits_CuckooSet_vector_ord_stat : public traits_CuckooSet_vector_ord + { + typedef cc::cuckoo::stat stat; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_ord_stat; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_ord_stat; + + struct traits_CuckooSet_vector_ord_storehash : public traits_CuckooSet_vector_ord + { + static CDS_CONSTEXPR const bool store_hash = true; + }; + typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_ord_storehash; + typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_ord_storehash; // *************************************************************************** @@ -1816,21 +1724,13 @@ namespace set2 { CPPUNIT_MSG( s.statistics() << s.mutex_policy_statistics() ); } - template - static inline void print_stat( CuckooStripedSet< V, Options... > const& s ) + template + static inline void print_stat( CuckooSet< V, Traits > const& s ) { - typedef CuckooStripedSet< V, Options... > set_type; + typedef CuckooSet< V, Traits > set_type; print_stat( static_cast(s) ); } - template - static inline void print_stat( CuckooRefinableSet< V, Options... > const& s ) - { - typedef CuckooRefinableSet< V, Options... > set_type; - print_stat( static_cast(s) ); - } - - //******************************************************* // additional_check -- 2.34.1