3 #ifndef CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
4 #define CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
6 #include <cds/container/details/base.h>
7 #include <cds/intrusive/details/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 /// MichaelList 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;
34 typedef cds::backoff::empty back_off;
36 /// Item counting feature; by default, disabled. Use \p cds::atomicity::item_counter to enable item counting
37 typedef atomicity::empty_item_counter item_counter;
39 /// C++ memory ordering model
41 Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
42 or \p opt::v::sequential_consistent (sequentially consisnent memory model).
44 typedef opt::v::relaxed_ordering memory_model;
46 /// RCU deadlock checking policy (only for \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList")
48 List of available options see opt::rcu_check_deadlock
50 typedef opt::v::rcu_throw_deadlock rcu_check_deadlock;
53 // MichaelKVList: supporting for split-ordered list
54 // key accessor (opt::none = internal key type is equal to user key type)
55 typedef opt::none key_accessor;
59 /// Metafunction converting option list to \p michael_list::traits
62 template <typename... Options>
64 # ifdef CDS_DOXYGEN_INVOKED
65 typedef implementation_defined type ; ///< Metafunction result
67 typedef typename cds::opt::make_options<
68 typename cds::opt::find_type_traits< traits, Options... >::type
75 } // namespace michael_list
77 // Forward declarations
78 template <typename GC, typename T, typename Traits=michael_list::traits>
81 template <typename GC, typename Key, typename Value, typename Traits=michael_list::traits>
84 // Tag for selecting Michael's list implementation
86 This struct is empty and it is used only as a tag for selecting MichaelList
87 as ordered list implementation in declaration of some classes.
89 See split_list::traits::ordered_list as an example.
91 struct michael_list_tag
94 }} // namespace cds::container
97 #endif // #ifndef CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H