3 #include "set/hdr_intrusive_striped_set.h"
4 #include <cds/intrusive/striped_set/boost_sg_set.h>
5 #include <cds/intrusive/striped_set.h>
8 namespace bi = boost::intrusive;
11 typedef IntrusiveStripedSetHdrTest::base_item< bi::bs_set_base_hook<> > base_item_type;
12 typedef IntrusiveStripedSetHdrTest::member_item< bi::bs_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 )
33 void IntrusiveStripedSetHdrTest::Striped_sg_set_basehook()
35 typedef ci::StripedSet<
36 bi::sg_set<base_item_type
37 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
38 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
40 ,co::mutex_policy< ci::striped_set::striping<> >
41 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
47 void IntrusiveStripedSetHdrTest::Striped_sg_set_basehook_bucket_threshold()
49 typedef ci::StripedSet<
50 bi::sg_set<base_item_type
51 , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
52 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
54 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
55 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
61 void IntrusiveStripedSetHdrTest::Striped_sg_set_basehook_bucket_threshold_rt()
63 typedef ci::StripedSet<
64 bi::sg_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> >
72 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );
76 void IntrusiveStripedSetHdrTest::Striped_sg_set_memberhook()
78 typedef ci::StripedSet<
81 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
82 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
83 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
85 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
91 void IntrusiveStripedSetHdrTest::Striped_sg_set_memberhook_bucket_threshold()
93 typedef ci::StripedSet<
96 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
97 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
98 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
100 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
101 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
107 void IntrusiveStripedSetHdrTest::Striped_sg_set_memberhook_bucket_threshold_rt()
109 typedef ci::StripedSet<
112 , bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
113 , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
114 CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
116 ,co::hash< IntrusiveStripedSetHdrTest::hash_int >
117 ,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
120 set_type s( 64, ci::striped_set::single_bucket_size_threshold<0>(256) );