bool unlink( value_type& val )
{
- iterator it = m_Set.find( value_type(val) );
+ iterator it = m_Set.find( value_type(val));
if ( it == m_Set.end() || &(*it) != &val )
return false;
m_Set.erase( it );
namespace {
typedef IntrusiveStripedSetHdrTest::base_item< bi::avl_set_base_hook<> > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< bi::avl_set_member_hook<> > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Refinable_avl_set_basehook()
{
typedef ci::StripedSet<
- bi::avl_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::avl_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::back_off< cds::backoff::empty >
void IntrusiveStripedSetHdrTest::Refinable_avl_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::avl_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::avl_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
,co::mutex_policy< ci::striped_set::refinable<> >
void IntrusiveStripedSetHdrTest::Refinable_avl_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::avl_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::avl_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
,co::mutex_policy< ci::striped_set::refinable<> >
member_item_type
, bi::member_hook< member_item_type, bi::avl_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
member_item_type
, bi::member_hook< member_item_type, bi::avl_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
member_item_type
, bi::member_hook< member_item_type, bi::avl_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::mutex_policy< ci::striped_set::refinable<> >
namespace {
typedef IntrusiveStripedSetHdrTest::base_item< bi::set_base_hook<> > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< bi::set_member_hook<> > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Refinable_set_basehook()
{
typedef ci::StripedSet<
- bi::set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::mutex_policy< ci::striped_set::refinable<> >
> set_type;
void IntrusiveStripedSetHdrTest::Refinable_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
,co::mutex_policy< ci::striped_set::refinable<> >
void IntrusiveStripedSetHdrTest::Refinable_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
,co::mutex_policy< ci::striped_set::refinable<> >
member_item_type
, bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::mutex_policy< ci::striped_set::refinable<> >
bi::set<
member_item_type
, bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
- , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
bi::set<
member_item_type
, bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
- , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
namespace {
typedef IntrusiveStripedSetHdrTest::base_item< bi::bs_set_base_hook<> > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< bi::bs_set_member_hook<> > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Refinable_sg_set_basehook()
{
typedef ci::StripedSet<
- bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::sg_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::mutex_policy< ci::striped_set::refinable<> >
> set_type;
void IntrusiveStripedSetHdrTest::Refinable_sg_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::sg_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
,co::mutex_policy< ci::striped_set::refinable<> >
void IntrusiveStripedSetHdrTest::Refinable_sg_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::sg_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
,co::mutex_policy< ci::striped_set::refinable<> >
member_item_type
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
member_item_type
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
member_item_type
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
#endif
typedef IntrusiveStripedSetHdrTest::base_item< splay_set_base_hook > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< splay_set_member_hook > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook()
{
typedef ci::StripedSet<
- bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::splay_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::back_off< cds::backoff::empty >
void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::splay_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
void IntrusiveStripedSetHdrTest::Refinable_splay_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::splay_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
member_item_type
, bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
member_item_type
, bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
member_item_type
, bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
return base_class::operator()( b, a );
}
};
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Refinable_treap_set_basehook()
{
typedef ci::StripedSet<
- bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
+ bi::treap_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ , bi::priority<priority_cmp<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
void IntrusiveStripedSetHdrTest::Refinable_treap_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
+ bi::treap_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >
+ , bi::priority<priority_cmp<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
void IntrusiveStripedSetHdrTest::Refinable_treap_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
+ bi::treap_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ , bi::priority<priority_cmp<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
, bi::priority<priority_cmp<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
, bi::priority<priority_cmp<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::mutex_policy< ci::striped_set::refinable<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
, bi::priority<priority_cmp<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
namespace {
typedef IntrusiveStripedSetHdrTest::base_item< bi::avl_set_base_hook<> > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< bi::avl_set_member_hook<> > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Striped_avl_set_basehook()
{
typedef ci::StripedSet<
- bi::avl_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::avl_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::striping<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_avl_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::avl_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::avl_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_avl_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::avl_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::avl_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
> set_type;
member_item_type
, bi::member_hook< member_item_type, bi::avl_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
member_item_type
, bi::member_hook< member_item_type, bi::avl_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
member_item_type
, bi::member_hook< member_item_type, bi::avl_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
namespace {
typedef IntrusiveStripedSetHdrTest::base_item< bi::set_base_hook<> > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< bi::set_member_hook<> > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
+
void IntrusiveStripedSetHdrTest::Striped_set_basehook()
{
typedef ci::StripedSet<
- bi::set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::striping<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
> set_type;
member_item_type
, bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
member_item_type
, bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
member_item_type
, bi::member_hook< member_item_type, bi::set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
namespace {
typedef IntrusiveStripedSetHdrTest::base_item< bi::bs_set_base_hook<> > base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< bi::bs_set_member_hook<> > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
+
void IntrusiveStripedSetHdrTest::Striped_sg_set_basehook()
{
typedef ci::StripedSet<
- bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::sg_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::mutex_policy< ci::striped_set::striping<> >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_sg_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::sg_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_sg_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::sg_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::sg_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
> set_type;
member_item_type
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
member_item_type
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
member_item_type
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
typedef IntrusiveStripedSetHdrTest::base_item< splay_set_base_hook> base_item_type;
typedef IntrusiveStripedSetHdrTest::member_item< splay_set_member_hook > member_item_type;
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
+
void IntrusiveStripedSetHdrTest::Striped_splay_set_basehook()
{
typedef ci::StripedSet<
- bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::splay_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::mutex_policy< ci::striped_set::striping<> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_splay_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::splay_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_splay_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::splay_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> > >
+ bi::splay_set<base_item_type
+ , bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
> set_type;
member_item_type
, bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
bi::splay_set<
member_item_type
, bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
- , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
bi::splay_set<
member_item_type
, bi::member_hook< member_item_type, splay_set_member_hook, &member_item_type::hMember>
- , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
+ , bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
return base_class::operator()( b, a );
}
};
+
+ template <typename T, typename Node>
+ struct get_key
+ {
+ typedef T type;
+
+ type const& operator()( Node const& v ) const
+ {
+ return v.nKey;
+ }
+ };
}
+#if BOOST_VERSION >= 105900
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type ) ,bi::key_of_value< get_key< int, type>>
+#else
+# define CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( type )
+#endif
+
void IntrusiveStripedSetHdrTest::Striped_treap_set_basehook()
{
typedef ci::StripedSet<
- bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
+ bi::treap_set < base_item_type,
+ bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>,
+ bi::priority<priority_cmp<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::mutex_policy< ci::striped_set::striping<> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_treap_set_basehook_bucket_threshold()
{
typedef ci::StripedSet<
- bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
+ bi::treap_set<base_item_type,
+ bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >,
+ bi::priority<priority_cmp<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<64> >
> set_type;
void IntrusiveStripedSetHdrTest::Striped_treap_set_basehook_bucket_threshold_rt()
{
typedef ci::StripedSet<
- bi::treap_set<base_item_type, bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type> >, bi::priority<priority_cmp<base_item_type> > >
+ bi::treap_set<base_item_type,
+ bi::compare<IntrusiveStripedSetHdrTest::less<base_item_type>>,
+ bi::priority<priority_cmp<base_item_type>>
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( base_item_type )
+ >
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
> set_type;
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
, bi::priority<priority_cmp<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
> set_type;
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
, bi::priority<priority_cmp<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<256> >
, bi::member_hook< member_item_type, bi::bs_set_member_hook<>, &member_item_type::hMember>
, bi::compare<IntrusiveStripedSetHdrTest::less<member_item_type> >
, bi::priority<priority_cmp<member_item_type> >
+ CDS_BOOST_INTRUSIVE_KEY_OF_VALUE_OPTION( member_item_type )
>
,co::hash< IntrusiveStripedSetHdrTest::hash_int >
,co::resizing_policy< ci::striped_set::single_bucket_size_threshold<0> >
item()
{}
+ explicit item( int key )
+ : nKey( key )
+ , nVal(0)
+ {}
+
item(int key, int val)
: nKey( key )
, nVal(val)
base_item()
{}
+ explicit base_item( int key )
+ : item( key )
+ {}
+
base_item(int key, int val)
: item( key, val )
{}
: item( static_cast<item const&>(v) )
, stat()
{}
+
+ operator int() const
+ {
+ return key();
+ }
};
template <typename Hook>
member_item()
{}
+ explicit member_item( int key )
+ : item( key )
+ {}
+
member_item(int key, int val)
: item( key, val )
{}
: item( static_cast<item const&>(v))
, stat()
{}
+
+ operator int() const
+ {
+ return key();
+ }
};
struct find_key {
{
return v1 < v2.key();
}
+
+ bool operator()( int i1, int i2 ) const
+ {
+ return i1 < i2;
+ }
};
template <typename T>
}
};
+ template <typename T>
+ struct get_int_key
+ {
+ int operator()( T const & v ) const
+ {
+ return v.key();
+ }
+ };
+
+ template <>
+ struct get_int_key<int>
+ {
+ int operator()( int i ) const
+ {
+ return i;
+ }
+ };
+
struct less2 {
template <typename Item>
bool operator()( Item const& e, find_key const& k ) const
{
- return e.key() < k.nKey;
+ return get_int_key<Item>()(e) < k.nKey;
}
template <typename Item>
bool operator()( find_key const& k, Item const& e ) const
{
- return k.nKey < e.key();
+ return k.nKey < get_int_key<Item>()(e);
}
- template <typename Item>
- bool operator()( Item const& e, int k ) const
- {
- return e.key() < k;
- }
- template <typename Item>
- bool operator()( int k, Item const& e ) const
+ template <typename Item1, typename Item2>
+ bool operator()( Item1 const& e, Item2 const& k ) const
{
- return k < e.key();
+ return get_int_key<Item1>()(e) < get_int_key<Item2>()(k);
}
};