3 #ifndef __CDS_CONTAINER_MICHAEL_LIST_BASE_H
4 #define __CDS_CONTAINER_MICHAEL_LIST_BASE_H
6 #include <cds/container/base.h>
7 #include <cds/intrusive/michael_list_base.h>
8 #include <cds/urcu/options.h>
10 namespace cds { namespace container {
12 /// MichaelList ordered list related definitions
13 /** @ingroup cds_nonintrusive_helper
15 namespace michael_list {
16 /// Michael list default type traits
19 typedef CDS_DEFAULT_ALLOCATOR allocator ; ///< allocator used to allocate new node
21 /// Key comparison functor
23 No default functor is provided. If the option is not specified, the \p less is used.
25 typedef opt::none compare;
27 /// specifies binary predicate used for key comparison.
29 Default is \p std::less<T>.
31 typedef opt::none less;
33 /// back-off strategy used
35 If the option is not specified, the cds::backoff::empty is used.
37 typedef cds::backoff::empty back_off;
41 The type for item counting feature.
42 Default is no item counter (\ref atomicity::empty_item_counter)
44 typedef atomicity::empty_item_counter item_counter;
46 /// Link fields checking feature
48 Default is \ref intrusive::opt::debug_check_link
50 static const opt::link_check_type link_checker = opt::debug_check_link;
52 /// C++ memory ordering model
54 List of available memory ordering see opt::memory_model
56 typedef opt::v::relaxed_ordering memory_model;
58 /// RCU deadlock checking policy (only for \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList")
60 List of available options see opt::rcu_check_deadlock
62 typedef opt::v::rcu_throw_deadlock rcu_check_deadlock;
65 // MichaelKVList: supporting for split-ordered list
66 // key accessor (opt::none = internal key type is equal to user key type)
67 typedef opt::none key_accessor;
71 /// Metafunction converting option list to MichaelList traits
73 This is a wrapper for <tt> cds::opt::make_options< type_traits, Options...> </tt>
75 See \ref MichaelList, \ref type_traits, \ref cds::opt::make_options.
77 template <CDS_DECL_OPTIONS9>
79 # ifdef CDS_DOXYGEN_INVOKED
80 typedef implementation_defined type ; ///< Metafunction result
82 typedef typename cds::opt::make_options<
83 typename cds::opt::find_type_traits< type_traits, CDS_OPTIONS9 >::type
90 } // namespace michael_list
92 // Forward declarations
93 template <typename GC, typename T, typename Traits=michael_list::type_traits>
96 template <typename GC, typename Key, typename Value, typename Traits=michael_list::type_traits>
99 // Tag for selecting Michael's list implementation
101 This struct is empty and it is used only as a tag for selecting MichaelList
102 as ordered list implementation in declaration of some classes.
104 See split_list::type_traits::ordered_list as an example.
106 struct michael_list_tag
109 }} // namespace cds::container
112 #endif // #ifndef __CDS_CONTAINER_MICHAEL_LIST_BASE_H