/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
public:
typedef cds::urcu::gc<RCU> gc; ///< Garbage collector
+ typedef Traits traits; ///< List traits
#ifdef CDS_DOXYGEN_INVOKED
typedef Key key_type ; ///< Key type
typedef Value mapped_type ; ///< Type of value stored in the list
typedef typename gc::scoped_lock rcu_lock ; ///< RCU scoped lock
static CDS_CONSTEXPR const bool c_bExtractLockExternal = base_class::c_bExtractLockExternal; ///< Group of \p extract_xxx functions require external locking
+ //@cond
+ // Rebind traits (split-list support)
+ template <typename... Options>
+ struct rebind_traits {
+ typedef LazyKVList<
+ gc
+ , key_type, mapped_type
+ , typename cds::opt::make_options< traits, Options...>::type
+ > type;
+ };
+
+ // Stat selector
+ template <typename Stat>
+ using select_stat_wrapper = typename base_class::template select_stat_wrapper< Stat >;
+ //@endcond
+
protected:
//@cond
typedef typename base_class::value_type node_type;
typedef typename base_class::template iterator_type<IsConst> iterator_base;
iterator_type( head_type const& pNode )
- : iterator_base( const_cast<head_type *>(&pNode) )
+ : iterator_base( const_cast<head_type *>(&pNode))
{}
iterator_type( head_type const * pNode )
- : iterator_base( const_cast<head_type *>(pNode) )
+ : iterator_base( const_cast<head_type *>(pNode))
{}
friend class LazyKVList;
*/
iterator begin()
{
- iterator it( head() );
+ iterator it( head());
++it ; // skip dummy head
return it;
}
*/
iterator end()
{
- return iterator( tail() );
+ return iterator( tail());
}
/// Returns a forward const iterator addressing the first element in a list
const_iterator begin() const
{
- const_iterator it( head() );
+ const_iterator it( head());
++it; // skip dummy head
return it;
}
/// Returns a forward const iterator addressing the first element in a list
const_iterator cbegin() const
{
- const_iterator it( head() );
+ const_iterator it( head());
++it; // skip dummy head
return it;
}
template <typename K>
bool erase( K const& key )
{
- return erase_at( head(), key, intrusive_key_comparator() );
+ return erase_at( head(), key, intrusive_key_comparator());
}
/// Deletes the item from the list using \p pred predicate for searching
bool erase_with( K const& key, Less pred )
{
CDS_UNUSED( pred );
- return erase_at( head(), key, typename maker::template less_wrapper<Less>::type() );
+ return erase_at( head(), key, typename maker::template less_wrapper<Less>::type());
}
/// Deletes \p key from the list
exempt_ptr extract_with( K const& key, Less pred )
{
CDS_UNUSED( pred );
- return exempt_ptr( extract_at( head(), key, typename maker::template less_wrapper<Less>::type() ));
+ return exempt_ptr( extract_at( head(), key, typename maker::template less_wrapper<Less>::type()));
}
/// Checks whether the list contains \p key
template <typename Q>
bool contains( Q const& key ) const
{
- return find_at( head(), key, intrusive_key_comparator() );
+ return find_at( head(), key, intrusive_key_comparator());
}
//@cond
template <typename Q>
bool contains( Q const& key, Less pred ) const
{
CDS_UNUSED( pred );
- return find_at( head(), key, typename maker::template less_wrapper<Less>::type() );
+ return find_at( head(), key, typename maker::template less_wrapper<Less>::type());
}
//@cond
template <typename Q, typename Less>