intrusive::SplitListSet refactoring
[libcds.git] / tests / test-hdr / set / hdr_intrusive_splitlist_set_rcu_gpb_lazy.cpp
index 76de301fb26daac98b0d7bf00ed86e221c69790f..a3cafcfb5e49c43360e6c1f3a8e792d2b888fd90 100644 (file)
@@ -29,7 +29,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -52,7 +52,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -77,7 +77,31 @@ namespace set {
                 ,ci::split_list::dynamic_bucket_table<true>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
+
+        test_rcu_int<set>();
+    }
+
+    void IntrusiveHashSetHdrTest::split_dyn_RCU_GPB_base_cmpmix_stat_lazy()
+    {
+        typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
+        struct list_traits : public ci::lazy_list::traits
+        {
+            typedef ci::lazy_list::base_hook< co::gc<rcu_type> > hook;
+            typedef IntrusiveHashSetHdrTest::less< item > less;
+            typedef cmp<item> compare;
+            typedef faked_disposer disposer;
+        };
+        typedef ci::LazyList< rcu_type, item, list_traits > ord_list;
+
+        struct set_traits : public ci::split_list::make_traits<ci::split_list::dynamic_bucket_table<true>>::type
+        {
+            typedef hash_int hash;
+            typedef simple_item_counter item_counter;
+            typedef ci::split_list::stat<> stat;
+        };
+        typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -103,7 +127,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -129,7 +153,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -156,11 +180,39 @@ namespace set {
                 ,co::item_counter< simple_item_counter >
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
 
+    void IntrusiveHashSetHdrTest::split_dyn_RCU_GPB_member_cmpmix_stat_lazy()
+    {
+        typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
+        struct list_traits :
+            public ci::lazy_list::make_traits<
+                ci::opt::hook< ci::lazy_list::member_hook<
+                    offsetof( item, hMember ),
+                    co::gc<rcu_type>
+                > >
+                ,co::compare< cmp<item> >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+            >::type
+        {};
+        typedef ci::LazyList< rcu_type, item, list_traits > ord_list;
+
+        struct set_traits :
+            public ci::split_list::make_traits<
+                co::hash< hash_int >
+                ,co::item_counter< simple_item_counter >
+                ,co::stat< ci::split_list::stat<> >
+            >::type
+        {};
+        typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
+
+        test_rcu_int<set>();
+    }
 
     // Static bucket table
     void IntrusiveHashSetHdrTest::split_st_RCU_GPB_base_cmp_lazy()
@@ -182,7 +234,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -206,7 +258,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -231,7 +283,33 @@ namespace set {
                 ,ci::split_list::dynamic_bucket_table<false>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
+
+        test_rcu_int<set>();
+    }
+
+    void IntrusiveHashSetHdrTest::split_st_RCU_GPB_base_cmpmix_stat_lazy()
+    {
+        typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
+        typedef ci::LazyList< rcu_type
+            ,item
+            ,ci::lazy_list::make_traits<
+                ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
+                ,co::less< less<item> >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+            >::type
+        >    ord_list;
+
+        typedef ci::SplitListSet< rcu_type, ord_list,
+            ci::split_list::make_traits<
+                co::hash< hash_int >
+                ,co::item_counter< simple_item_counter >
+                ,ci::split_list::dynamic_bucket_table<false>
+                ,co::stat< ci::split_list::stat<>>
+            >::type
+        > set;
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -258,7 +336,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -285,7 +363,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -313,10 +391,38 @@ namespace set {
                 ,ci::split_list::dynamic_bucket_table<false>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
 
+    void IntrusiveHashSetHdrTest::split_st_RCU_GPB_member_cmpmix_stat_lazy()
+    {
+        typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
+        typedef ci::LazyList< rcu_type
+            ,item
+            ,ci::lazy_list::make_traits<
+                ci::opt::hook< ci::lazy_list::member_hook<
+                    offsetof( item, hMember ),
+                    co::gc<rcu_type>
+                > >
+                ,co::compare< cmp<item> >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+            >::type
+        >    ord_list;
+
+        typedef ci::SplitListSet< rcu_type, ord_list,
+            ci::split_list::make_traits<
+                co::hash< hash_int >
+                ,co::item_counter< simple_item_counter >
+                ,ci::split_list::dynamic_bucket_table<false>
+                ,co::stat< ci::split_list::stat<>>
+            >::type
+        > set;
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
+
+        test_rcu_int<set>();
+    }
 
 } // namespace set