SplitListMap refactoring
[libcds.git] / tests / test-hdr / map / hdr_splitlist_map_rcu_sht.cpp
index 676566295492690b91cffbd75aa9857edd14f414..af2973d45a12ff8d7329ff30a90c62e69153bd0a 100644 (file)
@@ -11,7 +11,7 @@ namespace map {
     namespace {
         typedef cds::urcu::gc< cds::urcu::signal_threaded<> >  rcu_type;
 
-        struct RCU_SHT_cmp_traits: public cc::split_list::type_traits
+        struct RCU_SHT_cmp_traits: public cc::split_list::traits
         {
             typedef cc::michael_list_tag                ordered_list;
             typedef HashMapHdrTest::hash_int            hash;
@@ -19,13 +19,13 @@ namespace map {
             typedef cc::opt::v::relaxed_ordering        memory_model;
             enum { dynamic_bucket_table = false };
 
-            struct ordered_list_traits: public cc::michael_list::type_traits
+            struct ordered_list_traits: public cc::michael_list::traits
             {
                 typedef HashMapHdrTest::cmp   compare;
             };
         };
 
-        struct RCU_SHT_less_traits: public cc::split_list::type_traits
+        struct RCU_SHT_less_traits: public cc::split_list::traits
         {
             typedef cc::michael_list_tag                ordered_list;
             typedef HashMapHdrTest::hash_int            hash;
@@ -33,24 +33,29 @@ namespace map {
             typedef cc::opt::v::sequential_consistent                      memory_model;
             enum { dynamic_bucket_table = true };
 
-            struct ordered_list_traits: public cc::michael_list::type_traits
+            struct ordered_list_traits: public cc::michael_list::traits
             {
                 typedef HashMapHdrTest::less   less;
             };
         };
 
-        struct RCU_SHT_cmpmix_traits: public cc::split_list::type_traits
+        struct RCU_cmpmix_traits: public cc::split_list::traits
         {
             typedef cc::michael_list_tag                ordered_list;
             typedef HashMapHdrTest::hash_int            hash;
             typedef HashMapHdrTest::simple_item_counter item_counter;
 
-            struct ordered_list_traits: public cc::michael_list::type_traits
+            struct ordered_list_traits: public cc::michael_list::traits
             {
                 typedef HashMapHdrTest::cmp   compare;
                 typedef std::less<HashMapHdrTest::key_type>     less;
             };
         };
+
+        struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
+        {
+            typedef cc::split_list::stat<> stat;
+        };
     }
 #endif
 
@@ -114,7 +119,34 @@ namespace map {
     {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
         // traits-based version
-        typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmpmix_traits > map_type;
+        typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
+        test_rcu< map_type >();
+
+        // option-based version
+        typedef cc::SplitListMap< rcu_type,
+            key_type,
+            value_type,
+            cc::split_list::make_traits<
+                cc::split_list::ordered_list<cc::michael_list_tag>
+                ,cc::opt::hash< hash_int >
+                ,cc::opt::item_counter< simple_item_counter >
+                ,cc::split_list::ordered_list_traits<
+                    cc::michael_list::make_traits<
+                    cc::opt::less< std::less<key_type> >
+                        ,cc::opt::compare< cmp >
+                    >::type
+                >
+            >::type
+        > opt_map;
+        test_rcu< opt_map >();
+#endif
+    }
+
+    void HashMapHdrTest::Split_RCU_SHT_cmpmix_stat()
+    {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+        // traits-based version
+        typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
         test_rcu< map_type >();
 
         // option-based version
@@ -125,6 +157,7 @@ namespace map {
                 cc::split_list::ordered_list<cc::michael_list_tag>
                 ,cc::opt::hash< hash_int >
                 ,cc::opt::item_counter< simple_item_counter >
+                ,cc::opt::stat<cc::split_list::stat<>>
                 ,cc::split_list::ordered_list_traits<
                     cc::michael_list::make_traits<
                     cc::opt::less< std::less<key_type> >