Added stripped uRCU to stress tests
[libcds.git] / test / stress / set / set_type.h
index 2c524ed500734cceb029828f744e9d107cc5376c..2925cf0128a4c750b34ecc680b3d1d7c2c4aa22d 100644 (file)
@@ -47,12 +47,12 @@ namespace set {
     namespace cc = cds::container;
     namespace co = cds::opt;
 
-    typedef cds::urcu::gc< cds::urcu::general_instant<> >   rcu_gpi;
-    typedef cds::urcu::gc< cds::urcu::general_buffered<> >  rcu_gpb;
-    typedef cds::urcu::gc< cds::urcu::general_threaded<> >  rcu_gpt;
+    typedef cds::urcu::gc< cds::urcu::general_instant_stripped >   rcu_gpi;
+    typedef cds::urcu::gc< cds::urcu::general_buffered_stripped >  rcu_gpb;
+    typedef cds::urcu::gc< cds::urcu::general_threaded_stripped >  rcu_gpt;
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
-    typedef cds::urcu::gc< cds::urcu::signal_buffered<> >  rcu_shb;
-    typedef cds::urcu::gc< cds::urcu::signal_threaded<> >  rcu_sht;
+    typedef cds::urcu::gc< cds::urcu::signal_buffered_stripped >  rcu_shb;
+    typedef cds::urcu::gc< cds::urcu::signal_threaded_stripped >  rcu_sht;
 #endif
 
     template <typename Key>
@@ -111,6 +111,23 @@ namespace set {
         }
     };
 
+    template <>
+    struct less<std::string>
+    {
+        bool operator ()( std::string const& k1, std::string const& k2 ) const
+        {
+            return cmp<std::string>()( k1, k2 ) < 0;
+        }
+        bool operator ()( std::string const& k1, char const* k2 ) const
+        {
+            return cmp<std::string>()( k1, k2 ) < 0;
+        }
+        bool operator ()( char const* k1, std::string const& k2 ) const
+        {
+            return cmp<std::string>()( k1, k2 ) < 0;
+        }
+    };
+
     template <typename T>
     struct hash
     {
@@ -140,6 +157,17 @@ namespace set {
         }
     };
 
+    template <>
+    struct hash<std::string>
+    {
+        typedef size_t result_type;
+        typedef std::string argument_type;
+
+        size_t operator()( std::string const& k ) const
+        {
+            return std::hash<std::string>()(k);
+        }
+    };
 
     // forward
     template <typename ImplSelector, typename Key, typename Value>