From e0488e8f808c943d3a479fd7abd12549066aaf98 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 30 Aug 2015 13:13:04 +0300 Subject: [PATCH] BronsonAVLTreeMap: - replaced ensure() with update() - replaced find( key ) with contains( key ) MapDelOdd MT-test was refactored for BronsonAVLTreeMap --- cds/container/bronson_avltree_map_rcu.h | 40 +++--- cds/container/ellen_bintree_set_rcu.h | 2 +- cds/container/impl/bronson_avltree_map_rcu.h | 20 +-- projects/Win/vc12/cds.vcxproj | 1 - projects/Win/vc12/cds.vcxproj.filters | 3 - projects/Win/vc12/unit-map-delodd.vcxproj | 2 +- tests/test-hdr/tree/hdr_bronson_avltree_map.h | 46 +++---- tests/unit/map2/map_defs.h | 128 ++++++------------ tests/unit/map2/map_delodd.h | 3 +- tests/unit/map2/map_delodd_bronsonavltree.cpp | 10 +- tests/unit/map2/map_type_bronson_avltree.h | 103 ++++++++------ 11 files changed, 155 insertions(+), 203 deletions(-) diff --git a/cds/container/bronson_avltree_map_rcu.h b/cds/container/bronson_avltree_map_rcu.h index 50725ec2..51a94da3 100644 --- a/cds/container/bronson_avltree_map_rcu.h +++ b/cds/container/bronson_avltree_map_rcu.h @@ -276,15 +276,15 @@ namespace cds { namespace container { # endif } - /// Ensures that the \p key exists in the map + /// Updates the value for \p key /** The operation performs inserting or changing data with lock-free manner. If the \p key not found in the map, then the new item created from \p key - will be inserted into the map (note that in this case the \ref key_type should be - constructible from type \p K). + will be inserted into the map iff \p bAllowInsert is \p true + (note that in this case the \ref key_type should be constructible from type \p K). Otherwise, the functor \p func is called with item found. - The functor \p Func may be a functor: + The functor \p Func signature is: \code struct my_functor { void operator()( bool bNew, key_type const& key, mapped_type& item ); @@ -295,7 +295,8 @@ namespace cds { namespace container { - \p bNew - \p true if the item has been inserted, \p false otherwise - \p item - value - The functor may change any fields of the \p item. The functor is called under the node lock. + The functor may change any fields of the \p item. The functor is called under the node lock, + the caller can change any field of \p item. RCU \p synchronize() method can be called. RCU should not be locked. @@ -304,7 +305,7 @@ namespace cds { namespace container { already exists. */ template - std::pair update( K const& key, Func func ) + std::pair update( K const& key, Func func, bool bAllowInsert = true ) { int result = base_class::do_update( key, key_comparator(), [&func]( node_type * pNode ) -> mapped_type* @@ -318,19 +319,11 @@ namespace cds { namespace container { func( false, pNode->m_key, *pVal ); return pVal; }, - update_flags::allow_insert | update_flags::allow_update + (bAllowInsert ? update_flags::allow_insert : 0) | update_flags::allow_update ); return std::make_pair( result != 0, (result & update_flags::result_inserted) != 0 ); } - //@cond - template - std::pair ensure( K const& key, Func func ) - { - return update( key, func ); - } - //@endcond - /// Delete \p key from the map /** @@ -600,7 +593,7 @@ namespace cds { namespace container { return base_class::find_with( key, pred, f ); } - /// Find the key \p key + /// Checks whether the map contains \p key /** The function searches the item with key equal to \p key and returns \p true if it is found, and \p false otherwise. @@ -608,22 +601,21 @@ namespace cds { namespace container { The function applies RCU lock internally. */ template - bool find( K const& key ) + bool contains( K const& key ) { - return base_class::find( key ); + return base_class::contains( key ); } - /// Finds the key \p val using \p pred predicate for searching + /// Checks whether the map contains \p key using \p pred predicate for searching /** - The function is an analog of \p find(K const&) - but \p pred is used for key comparing. + The function is similar to contains( key ) but \p pred is used for key comparing. \p Less functor has the interface like \p std::less. - \p Less must imply the same element order as the comparator used for building the map. + \p Less must imply the same element order as the comparator used for building the set. */ template - bool find_with( K const& key, Less pred ) + bool contains( K const& key, Less pred ) { - return base_class::find_with( key, pred ); + return base_class::contains( key, pred ); } /// Clears the map diff --git a/cds/container/ellen_bintree_set_rcu.h b/cds/container/ellen_bintree_set_rcu.h index e9ac66f2..73e80434 100644 --- a/cds/container/ellen_bintree_set_rcu.h +++ b/cds/container/ellen_bintree_set_rcu.h @@ -259,7 +259,7 @@ namespace cds { namespace container { template std::pair ensure( const Q& val, Func func ) { - return update( val, func true ); + return update( val, func, true ); } //@endcond diff --git a/cds/container/impl/bronson_avltree_map_rcu.h b/cds/container/impl/bronson_avltree_map_rcu.h index 4451ad8c..4b362d3f 100644 --- a/cds/container/impl/bronson_avltree_map_rcu.h +++ b/cds/container/impl/bronson_avltree_map_rcu.h @@ -295,13 +295,6 @@ namespace cds { namespace container { return std::make_pair( result != 0, (result & update_flags::result_inserted) != 0 ); } - //@cond - template - std::pair ensure( K const& key, mapped_type pVal ) - { - return update( key, pVal, true ); - } - //@endcond /// Delete \p key from the map @@ -621,7 +614,7 @@ namespace cds { namespace container { ); } - /// Find the key \p key + /// Checks whether the map contains \p key /** The function searches the item with key equal to \p key and returns \p true if it is found, and \p false otherwise. @@ -629,20 +622,19 @@ namespace cds { namespace container { The function applies RCU lock internally. */ template - bool find( K const& key ) + bool contains( K const& key ) { return do_find( key, key_comparator(), []( node_type * ) -> bool { return true; }); } - /// Finds the key \p val using \p pred predicate for searching + /// Checks whether the map contains \p key using \p pred predicate for searching /** - The function is an analog of \p find(K const&) - but \p pred is used for key comparing. + The function is similar to contains( key ) but \p pred is used for key comparing. \p Less functor has the interface like \p std::less. - \p Less must imply the same element order as the comparator used for building the map. + \p Less must imply the same element order as the comparator used for building the set. */ template - bool find_with( K const& key, Less pred ) + bool contains( K const& key, Less pred ) { CDS_UNUSED( pred ); return do_find( key, cds::opt::details::make_comparator_from_less(), []( node_type * ) -> bool { return true; } ); diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index ee2a355b..245555c0 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -753,7 +753,6 @@ - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index e5928da4..fe212fb0 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -1148,9 +1148,6 @@ Header Files\cds\algo - - Header Files\cds\intrusive - Header Files\cds\container\details diff --git a/projects/Win/vc12/unit-map-delodd.vcxproj b/projects/Win/vc12/unit-map-delodd.vcxproj index 8ae26e0e..fae5da4b 100644 --- a/projects/Win/vc12/unit-map-delodd.vcxproj +++ b/projects/Win/vc12/unit-map-delodd.vcxproj @@ -45,7 +45,7 @@ - true + false true diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map.h b/tests/test-hdr/tree/hdr_bronson_avltree_map.h index 785256c1..15618f98 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map.h +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map.h @@ -120,7 +120,7 @@ namespace tree { }; template - static void ensure_func( bool bNew, Q key, value_type& i ) + static void update_func( bool bNew, Q key, value_type& i ) { i.nVal = key * 100; if ( bNew ) @@ -129,12 +129,12 @@ namespace tree { ++i.stat.nEnsureExistFuncCall; } - struct ensure_functor + struct update_functor { template void operator()( bool bNew, Q key, value_type& i ) { - ensure_func( bNew, key, i ); + update_func( bNew, key, i ); } }; @@ -155,22 +155,22 @@ namespace tree { typedef typename Set::exempt_ptr exempt_ptr; // insert/find test - CPPUNIT_ASSERT( !s.find( 10 ) ); + CPPUNIT_ASSERT( !s.contains( 10 ) ); CPPUNIT_ASSERT( s.insert( 10 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 1 ) ); - CPPUNIT_ASSERT( s.find( 10 ) ); + CPPUNIT_ASSERT( s.contains( 10 ) ); CPPUNIT_ASSERT( !s.insert( 10 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 1 ) ); - CPPUNIT_ASSERT( !s.find_with( 20, std::less() ) ); + CPPUNIT_ASSERT( !s.contains( 20, std::less() ) ); CPPUNIT_ASSERT( s.insert( 20, 25 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 2 ) ); - CPPUNIT_ASSERT( s.find_with( 10, std::less() ) ); - CPPUNIT_ASSERT( s.find( key = 20 ) ); + CPPUNIT_ASSERT( s.contains( 10, std::less() ) ); + CPPUNIT_ASSERT( s.contains( key = 20 ) ); CPPUNIT_ASSERT( s.find_with( key, std::less(), find_functor() ) ); { copy_found f; @@ -198,7 +198,7 @@ namespace tree { CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 2 ) ); - CPPUNIT_ASSERT( !s.find( 25 ) ); + CPPUNIT_ASSERT( !s.contains( 25 ) ); CPPUNIT_ASSERT( s.insert_with( 25, insert_functor() ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 3 ) ); @@ -219,8 +219,8 @@ namespace tree { CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 ); CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 ); } - std::pair ensureResult = s.update( key, ensure_functor() ); - CPPUNIT_ASSERT( ensureResult.first && !ensureResult.second ); + std::pair updateResult = s.update( key, update_functor() ); + CPPUNIT_ASSERT( updateResult.first && !updateResult.second ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 3 ) ); { @@ -231,12 +231,12 @@ namespace tree { CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 ); } - ensureResult = s.update( 13, []( bool /*bNew*/, key_type key, value_type& v ) + updateResult = s.update( 13, []( bool /*bNew*/, key_type key, value_type& v ) { v.nVal = key * 1000; ++v.stat.nEnsureNewFuncCall; }); - CPPUNIT_ASSERT( ensureResult.first && ensureResult.second ); + CPPUNIT_ASSERT( updateResult.first && updateResult.second ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 4 ) ); { @@ -250,23 +250,23 @@ namespace tree { // erase test CPPUNIT_ASSERT( s.erase( 13 ) ); - CPPUNIT_ASSERT( !s.find( 13 ) ); + CPPUNIT_ASSERT( !s.contains( 13 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 3 ) ); CPPUNIT_ASSERT( !s.erase( 13 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 3 ) ); - CPPUNIT_ASSERT( s.find( 10 ) ); + CPPUNIT_ASSERT( s.contains( 10 ) ); CPPUNIT_ASSERT( s.erase_with( 10, std::less() ) ); - CPPUNIT_ASSERT( !s.find( 10 ) ); + CPPUNIT_ASSERT( !s.contains( 10 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 2 ) ); CPPUNIT_ASSERT( !s.erase_with( 10, std::less() ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 2 ) ); - CPPUNIT_ASSERT( s.find( 20 ) ); + CPPUNIT_ASSERT( s.contains( 20 ) ); { copy_found f; CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) ); @@ -276,7 +276,7 @@ namespace tree { CPPUNIT_ASSERT( s.erase_with( 235, std::less(), std::ref( f ) ) ); CPPUNIT_ASSERT( f.m_found.nVal == 2350 ); } - CPPUNIT_ASSERT( !s.find( 20 ) ); + CPPUNIT_ASSERT( !s.contains( 20 ) ); CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 1 ) ); @@ -290,18 +290,18 @@ namespace tree { CPPUNIT_ASSERT( !s.empty() ); CPPUNIT_ASSERT( check_size( s, 2 ) ); - CPPUNIT_ASSERT( s.find( 151 ) ); - CPPUNIT_ASSERT( s.find_with( 174, std::less() ) ); - CPPUNIT_ASSERT( !s.find( 190 ) ); + CPPUNIT_ASSERT( s.contains( 151 ) ); + CPPUNIT_ASSERT( s.contains( 174, std::less() ) ); + CPPUNIT_ASSERT( !s.contains( 190 ) ); { copy_found f; key = 151; - CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) ); + CPPUNIT_ASSERT( s.find( key, std::ref( f ))); CPPUNIT_ASSERT( f.m_found.nVal == 0 ); key = 174; - CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) ); + CPPUNIT_ASSERT( s.find( key, std::ref( f ))); CPPUNIT_ASSERT( f.m_found.nVal == 471 ); } diff --git a/tests/unit/map2/map_defs.h b/tests/unit/map2/map_defs.h index 9adc9845..f8559b30 100644 --- a/tests/unit/map2/map_defs.h +++ b/tests/unit/map2/map_defs.h @@ -458,44 +458,26 @@ // ************************************************************************************** -// BronsonACLTreeMap +// BronsonAVLTreeMap #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED # define CDSUNIT_DECLARE_BronsonAVLTreeMap_RCU_signal \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_cmp_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_cmp_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_simple) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_simple) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_lazy) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_lazy) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_bounded) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_bounded) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat) \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat) \ - -# define CDSUNIT_DEFINE_BronsonAVLTreeMap_RCU_signal(IMPL, C) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_cmp_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_cmp_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less_pool_simple) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less_pool_simple) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less_pool_lazy) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less_pool_lazy) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less_pool_bounded) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less_pool_bounded) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_cmp_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_cmp_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_simple) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_simple) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_lazy) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_lazy) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_bounded) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_bounded) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat) \ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat) \ # define CDSUNIT_TEST_BronsonAVLTreeMap_RCU_signal \ CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less) \ @@ -517,64 +499,36 @@ #else # define CDSUNIT_DECLARE_BronsonAVLTreeMap_RCU_signal -# define CDSUNIT_DEFINE_BronsonAVLTreeMap_RCU_signal(IMPL, C) # define CDSUNIT_TEST_BronsonAVLTreeMap_RCU_signal #endif #define CDSUNIT_DECLARE_BronsonAVLTreeMap \ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_cmp_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_cmp_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_cmp_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_simple)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_simple)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_simple)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_lazy)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_lazy)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_lazy)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_bounded)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_bounded)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_bounded)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat)\ - CDSUNIT_DECLARE_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_cmp_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_cmp_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_cmp_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_simple)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_simple)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_simple)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_lazy)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_lazy)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_lazy)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_bounded)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_bounded)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_bounded)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat)\ + TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat)\ CDSUNIT_DECLARE_BronsonAVLTreeMap_RCU_signal -#define CDSUNIT_DEFINE_BronsonAVLTreeMap( IMPL, C ) \ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_cmp_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_cmp_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_cmp_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less_pool_simple)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less_pool_simple)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less_pool_simple)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less_pool_lazy)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less_pool_lazy)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less_pool_lazy)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less_pool_bounded)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less_pool_bounded)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less_pool_bounded)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat)\ - TEST_MAP_NOLF_EXTRACT(IMPL, C, BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat)\ - CDSUNIT_DEFINE_BronsonAVLTreeMap_RCU_signal( IMPL, C ) - #define CDSUNIT_TEST_BronsonAVLTreeMap \ CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less)\ CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_cmp_stat)\ diff --git a/tests/unit/map2/map_delodd.h b/tests/unit/map2/map_delodd.h index fe45c678..57a6db6f 100644 --- a/tests/unit/map2/map_delodd.h +++ b/tests/unit/map2/map_delodd.h @@ -693,6 +693,7 @@ namespace map2 { CDSUNIT_DECLARE_SplitList CDSUNIT_DECLARE_SkipListMap CDSUNIT_DECLARE_EllenBinTreeMap + CDSUNIT_DECLARE_BronsonAVLTreeMap // This test is not suitable for MultiLevelHashMap //CDSUNIT_DECLARE_MultiLevelHashMap @@ -702,6 +703,7 @@ namespace map2 { CDSUNIT_TEST_SplitList CDSUNIT_TEST_SkipListMap CDSUNIT_TEST_EllenBinTreeMap + CDSUNIT_TEST_BronsonAVLTreeMap //CDSUNIT_TEST_MultiLevelHashMap // the test is not suitable CPPUNIT_TEST_SUITE_END(); @@ -709,7 +711,6 @@ namespace map2 { ////CDSUNIT_DECLARE_StripedMap ////CDSUNIT_DECLARE_RefinableMap //CDSUNIT_DECLARE_CuckooMap - //CDSUNIT_DECLARE_BronsonAVLTreeMap //CDSUNIT_DECLARE_MultiLevelHashMap ////CDSUNIT_DECLARE_StdMap }; diff --git a/tests/unit/map2/map_delodd_bronsonavltree.cpp b/tests/unit/map2/map_delodd_bronsonavltree.cpp index 2d2df6ad..3c5f7942 100644 --- a/tests/unit/map2/map_delodd_bronsonavltree.cpp +++ b/tests/unit/map2/map_delodd_bronsonavltree.cpp @@ -3,10 +3,10 @@ #include "map2/map_delodd.h" #include "map2/map_type_bronson_avltree.h" -namespace map2 { - CDSUNIT_DEFINE_BronsonAVLTreeMap( cc::bronson_avltree::implementation_tag, Map_DelOdd) +#undef TEST_CASE +#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } +#include "map2/map_defs.h" - CPPUNIT_TEST_SUITE_PART( Map_DelOdd, run_BronsonAVLTreeMap ) - CDSUNIT_TEST_BronsonAVLTreeMap - CPPUNIT_TEST_SUITE_END_PART() +namespace map2 { + CDSUNIT_DECLARE_BronsonAVLTreeMap } // namespace map2 diff --git a/tests/unit/map2/map_type_bronson_avltree.h b/tests/unit/map2/map_type_bronson_avltree.h index 5296dfbd..2fee7d8a 100644 --- a/tests/unit/map2/map_type_bronson_avltree.h +++ b/tests/unit/map2/map_type_bronson_avltree.h @@ -14,8 +14,25 @@ namespace map2 { + template + class BronsonAVLTreeMap : public cc::BronsonAVLTreeMap< GC, Key, T, Traits > + { + typedef cc::BronsonAVLTreeMap< GC, Key, T, Traits > base_class; + public: + template + BronsonAVLTreeMap( Config const& /*cfg*/) + : base_class() + {} + + // for testing + static CDS_CONSTEXPR bool const c_bExtractSupported = true; + static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; + }; + + struct tag_BronsonAVLTreeMap; + template - struct map_type< cc::bronson_avltree::implementation_tag, Key, Value >: public map_type_base< Key, Value > + struct map_type< tag_BronsonAVLTreeMap, Key, Value >: public map_type_base< Key, Value > { typedef map_type_base< Key, Value > base_class; typedef typename base_class::compare compare; @@ -32,12 +49,12 @@ namespace map2 { ,co::item_counter< cds::atomicity::item_counter > >::type {}; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpi_less; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpb_less; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpt_less; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpi_less; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpb_less; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpt_less; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_shb_less; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_sht_less; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_shb_less; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_sht_less; #endif struct BronsonAVLTreeMap_cmp_stat: public cc::bronson_avltree::make_traits< @@ -47,48 +64,48 @@ namespace map2 { ,co::stat< cc::bronson_avltree::stat<>> >::type {}; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpi_cmp_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpb_cmp_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpt_cmp_stat; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpi_cmp_stat; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpb_cmp_stat; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpt_cmp_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_shb_cmp_stat; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_sht_cmp_stat; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_shb_cmp_stat; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_sht_cmp_stat; #endif struct BronsonAVLTreeMap_less_pool_simple: public BronsonAVLTreeMap_less { typedef cds::sync::pool_monitor sync_monitor; }; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpi_less_pool_simple; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpb_less_pool_simple; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpt_less_pool_simple; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpi_less_pool_simple; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpb_less_pool_simple; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpt_less_pool_simple; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_shb_less_pool_simple; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_sht_less_pool_simple; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_shb_less_pool_simple; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_sht_less_pool_simple; #endif struct BronsonAVLTreeMap_less_pool_simple_stat : public BronsonAVLTreeMap_less { typedef cc::bronson_avltree::stat<> stat; typedef cds::sync::pool_monitor sync_monitor; }; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat; #endif struct BronsonAVLTreeMap_less_pool_lazy: public BronsonAVLTreeMap_less { typedef cds::sync::pool_monitor sync_monitor; static CDS_CONSTEXPR bool const relaxed_insert = true; }; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpt_less_pool_lazy; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpt_less_pool_lazy; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_shb_less_pool_lazy; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_sht_less_pool_lazy; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_shb_less_pool_lazy; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_sht_less_pool_lazy; #endif struct BronsonAVLTreeMap_less_pool_lazy_stat : public BronsonAVLTreeMap_less { @@ -96,24 +113,24 @@ namespace map2 { typedef cds::sync::pool_monitor sync_monitor; static CDS_CONSTEXPR bool const relaxed_insert = true; }; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat; #endif struct BronsonAVLTreeMap_less_pool_bounded: public BronsonAVLTreeMap_less { typedef cds::sync::pool_monitor sync_monitor; static CDS_CONSTEXPR bool const relaxed_insert = true; }; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpt_less_pool_bounded; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpt_less_pool_bounded; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_shb_less_pool_bounded; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_sht_less_pool_bounded; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_shb_less_pool_bounded; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_sht_less_pool_bounded; #endif struct BronsonAVLTreeMap_less_pool_bounded_stat : public BronsonAVLTreeMap_less { @@ -121,24 +138,24 @@ namespace map2 { typedef cds::sync::pool_monitor sync_monitor; static CDS_CONSTEXPR bool const relaxed_insert = true; }; - typedef cc::BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat; - typedef cc::BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat; + typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat; + typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat; + typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat; - typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat; + typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat; + typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat; #endif }; template - static inline void print_stat( cc::BronsonAVLTreeMap const& m ) + static inline void print_stat( BronsonAVLTreeMap const& m ) { CPPUNIT_MSG( m.statistics() ); CPPUNIT_MSG( m.monitor().statistics() ); } template - static inline void check_before_cleanup( cc::BronsonAVLTreeMap& m ) + static inline void check_before_cleanup( BronsonAVLTreeMap& m ) { CPPUNIT_MSG( " Check internal consistency (single-threaded)..." ); bool bOk = m.check_consistency([]( size_t nLevel, size_t hLeft, size_t hRight ) -- 2.34.1