#define __CDS_INTRUSIVE_DETAILS_MICHAEL_LIST_BASE_H
#include <type_traits>
-#include <functional> // ref
#include <cds/intrusive/details/base.h>
#include <cds/opt/compare.h>
#include <cds/cxx11_atomic.h>
#include <cds/details/marked_ptr.h>
-#include <cds/details/make_const_type.h>
#include <cds/urcu/options.h>
namespace cds { namespace intrusive {
//@endcond
};
- /// Check link
+ /// Checks link
template <typename Node>
struct link_checker
{
//@endcond
};
- /// Type traits for MichaelList class
- struct type_traits
+ /// MichaelList traits
+ struct traits
{
/// Hook used
/**
- Possible values are: michael_list::base_hook, michael_list::member_hook, michael_list::traits_hook.
+ Possible values are: \p michael_list::base_hook, \p michael_list::member_hook, \p michael_list::traits_hook.
*/
typedef base_hook<> hook;
*/
typedef opt::none compare;
- /// specifies binary predicate used for key compare.
+ /// Specifies binary predicate used for key compare.
/**
Default is \p std::less<T>.
*/
typedef opt::none less;
- /// back-off strategy used
- /**
- If the option is not specified, the cds::backoff::Default is used.
- */
+ /// Back-off strategy
typedef cds::backoff::Default back_off;
- /// Disposer
- /**
- the functor used for dispose removed items. Default is opt::v::empty_disposer.
- */
+ /// Disposer for removing items
typedef opt::v::empty_disposer disposer;
- /// Item counter
- /**
- The type for item counting feature.
- Default is no item counter (\ref atomicity::empty_item_counter)
- */
+ /// Item counting feature; by default, disabled. Use \p cds::atomicity::item_counter to enable item counting
typedef atomicity::empty_item_counter item_counter;
/// Link fields checking feature
/**
- Default is \ref opt::debug_check_link
+ Default is \p opt::debug_check_link
*/
static const opt::link_check_type link_checker = opt::debug_check_link;
/// C++ memory ordering model
- /**
- List of available memory ordering see opt::memory_model
+ /**
+ Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
+ or \p opt::v::sequential_consistent (sequentially consisnent memory model).
*/
typedef opt::v::relaxed_ordering memory_model;
/// RCU deadlock checking policy (only for \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList")
/**
- List of available options see opt::rcu_check_deadlock
+ List of available policy see \p opt::rcu_check_deadlock
*/
typedef opt::v::rcu_throw_deadlock rcu_check_deadlock;
};
- /// Metafunction converting option list to traits
+ /// Metafunction converting option list to \p michael_list::traits
/**
- This is a wrapper for <tt> cds::opt::make_options< type_traits, Options...> </tt>
- \p Options list see \ref MichaelList.
+ Supported \p Options are:
+ - \p opt::hook - hook used. Possible values are: \p michael_list::base_hook, \p michael_list::member_hook, \p michael_list::traits_hook.
+ If the option is not specified, \p %michael_list::base_hook<> and \p gc::HP is used.
+ - \p opt::compare - key comparison functor. No default functor is provided.
+ If the option is not specified, the \p opt::less is used.
+ - \p opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
+ - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used.
+ - \p opt::disposer - the functor used for disposing removed items. Default is \p opt::v::empty_disposer. Due the nature
+ of GC schema the disposer may be called asynchronously.
+ - \p opt::link_checker - the type of node's link fields checking. Default is \p opt::debug_check_link
+ - \p opt::item_counter - the type of item counting feature. Default is disabled (\p atomicity::empty_item_counter).
+ To enable item counting use \p atomicity::item_counter.
+ - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
+ or \p opt::v::sequential_consistent (sequentially consisnent memory model).
+ - \p opt::rcu_check_deadlock - a deadlock checking policy for \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList"
+ Default is \p opt::v::rcu_throw_deadlock
*/
template <typename... Options>
struct make_traits {
typedef implementation_defined type ; ///< Metafunction result
# else
typedef typename cds::opt::make_options<
- typename cds::opt::find_type_traits< type_traits, Options... >::type
+ typename cds::opt::find_type_traits< traits, Options... >::type
,Options...
>::type type;
- //typedef typename cds::opt::make_options< type_traits, Options...>::type type ; ///< Result of metafunction
# endif
};
//@cond
// Forward declaration
- template < class GC, typename T, class Traits = michael_list::type_traits >
+ template < class GC, typename T, class Traits = michael_list::traits >
class MichaelList;
//@endcond