/// Type traits for SplitListSet class
/**
- Note, the SplitListSet type traits is based on intrusive::split_list::type_traits.
- Any member declared in intrusive::split_list::type_traits is also applied to
- container::split_list::type_traits.
+ Note, the SplitListSet type traits is based on intrusive::split_list::traits.
+ Any member declared in intrusive::split_list::traits is also applied to
+ container::split_list::traits.
*/
struct type_traits: public intrusive::split_list::type_traits
{
If this option is opt::none, the ordered list traits is combined with default
ordered list traits and split-list traits.
- For \p michael_list_tag, the default traits is \ref container::michael_list::type_traits.
+ For \p michael_list_tag, the default traits is \p container::michael_list::traits.
- For \p lazy_list_tag, the default traits is \ref container::lazy_list::type_traits.
+ For \p lazy_list_tag, the default traits is \p container::lazy_list::traits.
*/
typedef opt::none ordered_list_traits;
- split_list::ordered_list - a tag for ordered list implementation.
See split_list::ordered_list for possible values.
- split_list::ordered_list_traits - type traits for ordered list implementation.
- For MichaelList use container::michael_list::type_traits,
- for LazyList use container::lazy_list::type_traits.
+ For MichaelList use \p container::michael_list::traits,
+ for LazyList use \p container::lazy_list::traits.
- plus any option from intrusive::split_list::make_traits
*/
template <typename... Options>
Template arguments:
- \p GC - Garbage collector used. Note the \p GC must be the same as the GC used for item type \p T (see \p michael_list::node).
- - \p T - type to be stored in the list. The type must be based on michael_list::node (for michael_list::base_hook)
- or it must have a member of type michael_list::node (for michael_list::member_hook).
+ - \p T - type to be stored in the list. The type must be based on \p michael_list::node (for \p michael_list::base_hook)
+ or it must have a member of type \p michael_list::node (for \p michael_list::member_hook).
- \p Traits - type traits, default is \p michael_list::traits. It is possible to declare option-based
list with \p cds::intrusive::michael_list::make_traits metafunction:
For example, the following traits-based declaration of \p gc::HP Michael's list
\endcode
\par Usage
- There are different specializations of this template for each garbage collecting schema used.
+ There are different specializations of this template for each garbage collecting schema.
You should select GC needed and include appropriate .h-file:
- - for gc::HP: \code #include <cds/intrusive/michael_list_hp.h> \endcode
- - for gc::DHP: \code #include <cds/intrusive/michael_list_dhp.h> \endcode
+ - for \p gc::HP: <tt> <cds/intrusive/michael_list_hp.h> </tt>
+ - for \p gc::DHP: <tt> <cds/intrusive/michael_list_dhp.h> </tt>
- for \ref cds_urcu_gc "RCU type" - see \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList"
- - for gc::nogc: \code #include <cds/intrusive/michael_list_nogc.h> \endcode
+ - for \p gc::nogc: <tt> <cds/intrusive/michael_list_nogc.h> </tt>
See \ref cds_intrusive_MichaelList_nogc "non-GC MichaelList"
- Then, you should incorporate michael_list::node into your struct \p T and provide
+ Then, you should incorporate \p michael_list::node into your struct \p T and provide
appropriate \p michael_list::traits::hook in your \p Traits template parameters. Usually, for \p Traits you
define a struct based on \p michael_list::traits.
- Example for \p gc::PTB and base hook:
+ Example for \p gc::DHP and base hook:
\code
// Include GC-related Michael's list specialization
#include <cds/intrusive/michael_list_dhp.h>
// Data stored in Michael's list
- struct my_data: public cds::intrusive::michael_list::node< cds::gc::PTB >
+ struct my_data: public cds::intrusive::michael_list::node< cds::gc::DHP >
{
// key field
std::string strKey;
// Declare traits
struct my_traits: public cds::intrusive::michael_list::traits
{
- typedef cds::intrusive::michael_list::base_hook< cds::opt::gc< cds::gc::PTB > > hook;
+ typedef cds::intrusive::michael_list::base_hook< cds::opt::gc< cds::gc::DHP > > hook;
typedef my_data_cmp compare;
};
// Declare list type
- typedef cds::intrusive::MichaelList< cds::gc::PTB, my_data, my_traits > traits_based_list;
+ typedef cds::intrusive::MichaelList< cds::gc::DHP, my_data, my_traits > traits_based_list;
\endcode
Equivalent option-based code:
};
// Declare option-based list
- typedef cds::intrusive::MichaelList< cds::gc::PTB
+ typedef cds::intrusive::MichaelList< cds::gc::DHP
,my_data
, typename cds::intrusive::michael_list::make_traits<
- cds::intrusive::opt::hook< cds::intrusive::michael_list::base_hook< cds::opt::gc< cds::gc::PTB > > >
+ cds::intrusive::opt::hook< cds::intrusive::michael_list::base_hook< cds::opt::gc< cds::gc::DHP > > >
,cds::intrusive::opt::compare< my_data_cmp >
>::type
> option_based_list;