3 #include "set/hdr_intrusive_striped_set.h"
4 #include <cds/intrusive/striped_set/boost_set.h>
5 #include <cds/intrusive/striped_set.h>
8 namespace bi = boost::intrusive;
11 typedef IntrusiveStripedSetHdrTest::base_item< bi::set_base_hook<> > base_item_type;
12 typedef IntrusiveStripedSetHdrTest::member_item< bi::set_member_hook<> > member_item_type;
14 template <typename T, typename Node>
19 type const& operator()( Node const& v ) const
26 #if BOOST_VERSION >= 105900
27 # define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
29 # define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
32 void IntrusiveStripedSetHdrTest::Refinable_set_basehook()
34 typedef ci::StripedSet<
35 bi::set<base_item_type
36 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
37 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
39 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
40 ,co::mutex_policy< ci::striped_set::refinable<> >
46 void IntrusiveStripedSetHdrTest::Refinable_set_basehook_bucket_threshold()
48 typedef ci::StripedSet<
49 bi::set<base_item_type
50 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
51 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
53 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
54 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
55 ,co::mutex_policy< ci::striped_set::refinable<> >
61 void IntrusiveStripedSetHdrTest::Refinable_set_basehook_bucket_threshold_rt()
63 typedef ci::StripedSet<
64 bi::set<base_item_type
65 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
66 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
68 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
69 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
70 ,co::mutex_policy< ci::striped_set::refinable<> >
73 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
77 void IntrusiveStripedSetHdrTest::Refinable_set_memberhook()
79 typedef ci::StripedSet<
82 , bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
83 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
84 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
86 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
87 ,co::mutex_policy< ci::striped_set::refinable<> >
93 void IntrusiveStripedSetHdrTest::Refinable_set_memberhook_bucket_threshold()
95 typedef ci::StripedSet<
98 , bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
99 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
100 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
102 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
103 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
104 ,co::mutex_policy< ci::striped_set::refinable<> >
110 void IntrusiveStripedSetHdrTest::Refinable_set_memberhook_bucket_threshold_rt()
112 typedef ci::StripedSet<
115 , bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
116 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
117 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
119 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
120 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
121 ,co::mutex_policy< ci::striped_set::refinable<> >
124 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );