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;
19 typedef IntrusiveStripedSetHdrTest::base_item< splay_set_base_hook > base_item_type;
20 typedef IntrusiveStripedSetHdrTest::member_item< splay_set_member_hook > member_item_type;
22 template <typename T, typename Node>
27 type const& operator()( Node const& v ) const
34 #if BOOST_VERSION >= 105900
35 # define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
37 # define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
40 void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook()
42 typedef ci::StripedSet<
43 bi::splay_set<base_item_type
44 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
45 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
47 ,co::mutex_policy< ci::striped_set::refinable<> >
48 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
49 ,co::back_off< cds::backoff::empty >
55 void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook_bucket_threshold()
57 typedef ci::StripedSet<
58 bi::splay_set<base_item_type
59 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
60 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
62 ,co::mutex_policy< ci::striped_set::refinable<> >
63 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
64 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
70 void IntrusiveStripedSetHdrTest::Refinable_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::mutex_policy< ci::striped_set::refinable<> >
78 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
79 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
82 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
86 void IntrusiveStripedSetHdrTest::Refinable_splay_set_memberhook()
88 typedef ci::StripedSet<
91 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
92 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
93 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
95 ,co::mutex_policy< ci::striped_set::refinable<> >
96 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
102 void IntrusiveStripedSetHdrTest::Refinable_splay_set_memberhook_bucket_threshold()
104 typedef ci::StripedSet<
107 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
108 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
109 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
111 ,co::mutex_policy< ci::striped_set::refinable<> >
112 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
113 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
119 void IntrusiveStripedSetHdrTest::Refinable_splay_set_memberhook_bucket_threshold_rt()
121 typedef ci::StripedSet<
124 , bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
125 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
126 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
128 ,co::mutex_policy< ci::striped_set::refinable<> >
129 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
130 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
133 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );