3 #ifndef __CDS_CONTAINER_LAZY_LIST_BASE_H
4 #define __CDS_CONTAINER_LAZY_LIST_BASE_H
6 #include <cds/container/base.h>
7 #include <cds/intrusive/lazy_list_base.h>
8 #include <cds/urcu/options.h>
10 namespace cds { namespace container {
12 /// LazyList ordered list related definitions
13 /** @ingroup cds_nonintrusive_helper
16 /// Lazy list default type traits
18 Either \p compare or \p less or both must be specified.
22 /// allocator used to allocate new node
23 typedef CDS_DEFAULT_ALLOCATOR allocator;
25 /// Key comparison functor
27 No default functor is provided. If the option is not specified, the \p less is used.
29 typedef opt::none compare;
31 /// specifies binary predicate used for key comparison.
33 Default is \p std::less<T>.
35 typedef opt::none less;
37 /// Lock type used to lock modifying items
39 Default is cds::lock::Spin
41 typedef cds::lock::Spin lock_type;
43 /// back-off strategy used
45 If the option is not specified, the cds::backoff::Default is used.
47 typedef cds::backoff::Default back_off;
51 The type for item counting feature.
52 Default is no item counter (\ref atomicity::empty_item_counter)
54 typedef atomicity::empty_item_counter item_counter;
56 /// Link fields checking feature
58 Default is \ref intrusive::opt::debug_check_link
60 static const opt::link_check_type link_checker = opt::debug_check_link;
62 /// C++ memory ordering model
64 List of available memory ordering see opt::memory_model
66 typedef opt::v::relaxed_ordering memory_model;
68 /// RCU deadlock checking policy (only for \ref cds_intrusive_LazyList_rcu "RCU-based LazyList")
70 List of available options see opt::rcu_check_deadlock
72 typedef opt::v::rcu_throw_deadlock rcu_check_deadlock;
75 // LazyKVList: supporting for split-ordered list
76 // key accessor (opt::none = internal key type is equal to user key type)
77 typedef opt::none key_accessor;
79 // for internal use only!!!
80 typedef opt::none boundary_node_type;
85 /// Metafunction converting option list to traits for LazyList
87 This is a wrapper for <tt> cds::opt::make_options< type_traits, Options...> </tt>
89 See \ref LazyList, \ref type_traits, \ref cds::opt::make_options.
91 template <CDS_DECL_OPTIONS12>
93 # ifdef CDS_DOXYGEN_INVOKED
94 typedef implementation_defined type ; ///< Metafunction result
96 typedef typename cds::opt::make_options<
97 typename cds::opt::find_type_traits< type_traits, CDS_OPTIONS12 >::type
104 } // namespace lazy_list
106 // Forward declarations
107 template <typename GC, typename T, typename Traits=lazy_list::type_traits>
110 template <typename GC, typename Key, typename Value, typename Traits=lazy_list::type_traits>
113 // Tag for selecting lazy list implementation
115 This struct is empty and it is used only as a tag for selecting LazyList
116 as ordered list implementation in declaration of some classes.
118 See split_list::type_traits::ordered_list as an example.
124 }} // namespace cds::container
127 #endif // #ifndef __CDS_CONTAINER_LAZY_LIST_BASE_H