3 #include "set/hdr_intrusive_striped_set.h"
4 #include <cds/intrusive/striped_set/boost_splay_set.h>
5 #include <cds/intrusive/striped_set.h>
6 #include <boost/version.hpp>
9 namespace bi = boost::intrusive;
12 # if BOOST_VERSION < 105600
13 typedef bi::splay_set_member_hook<> splay_set_member_hook;
14 typedef bi::splay_set_base_hook<> splay_set_base_hook;
16 typedef bi::bs_set_base_hook<> splay_set_base_hook;
17 typedef bi::bs_set_member_hook<> splay_set_member_hook;
20 typedef IntrusiveStripedSetHdrTest::base_item< splay_set_base_hook> base_item_type;
21 typedef IntrusiveStripedSetHdrTest::member_item< splay_set_member_hook > member_item_type;
23 template <typename T, typename Node>
28 type const& operator()( Node const& v ) const
35 #if BOOST_VERSION >= 105900
36 # define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
38 # define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
42 void IntrusiveStripedSetHdrTest::Striped_splay_set_basehook()
44 typedef ci::StripedSet<
45 bi::splay_set<base_item_type
46 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
47 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
49 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
50 ,co::mutex_policy< ci::striped_set::striping<> >
56 void IntrusiveStripedSetHdrTest::Striped_splay_set_basehook_bucket_threshold()
58 typedef ci::StripedSet<
59 bi::splay_set<base_item_type
60 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
61 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
63 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
64 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
70 void IntrusiveStripedSetHdrTest::Striped_splay_set_basehook_bucket_threshold_rt()
72 typedef ci::StripedSet<
73 bi::splay_set<base_item_type
74 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
75 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
77 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
78 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
81 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
85 void IntrusiveStripedSetHdrTest::Striped_splay_set_memberhook()
87 typedef ci::StripedSet<
90 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
91 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
92 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
94 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
100 void IntrusiveStripedSetHdrTest::Striped_splay_set_memberhook_bucket_threshold()
102 typedef ci::StripedSet<
105 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
106 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
107 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
109 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
110 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
116 void IntrusiveStripedSetHdrTest::Striped_splay_set_memberhook_bucket_threshold_rt()
118 typedef ci::StripedSet<
121 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
122 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
123 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
125 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
126 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
129 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );