bugfix in cds::gc::HP::guarded_ptr
[libcds.git] / tests / test-hdr / ordered_list / hdr_intrusive_michael_list_rcu_gpb.cpp
1 //$$CDS-header$$
2
3 #include "ordered_list/hdr_intrusive_michael.h"
4 #include <cds/urcu/general_buffered.h>
5 #include <cds/intrusive/michael_list_rcu.h>
6
7 namespace ordlist {
8     namespace {
9         typedef cds::urcu::gc< cds::urcu::general_buffered<> >    RCU;
10     }
11
12     void IntrusiveMichaelListHeaderTest::RCU_GPB_base_cmp()
13     {
14         typedef base_int_item< RCU > item;
15         struct traits : public ci::michael_list::traits
16         {
17             typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
18             typedef cmp<item> compare;
19             typedef faked_disposer disposer;
20         };
21         typedef ci::MichaelList< RCU, item, traits > list;
22         test_rcu_int<list>();
23     }
24     void IntrusiveMichaelListHeaderTest::RCU_GPB_base_less()
25     {
26         typedef base_int_item< RCU > item;
27         struct traits : public ci::michael_list::traits
28         {
29             typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
30             typedef IntrusiveMichaelListHeaderTest::less<item> less;
31             typedef faked_disposer disposer;
32         };
33         typedef ci::MichaelList< RCU, item, traits > list;
34         test_rcu_int<list>();
35     }
36     void IntrusiveMichaelListHeaderTest::RCU_GPB_base_cmpmix()
37     {
38         typedef base_int_item< RCU > item;
39         typedef ci::MichaelList< RCU
40             ,item
41             ,ci::michael_list::make_traits<
42                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
43                 ,co::less< less<item> >
44                 ,co::compare< cmp<item> >
45                 ,ci::opt::disposer< faked_disposer >
46             >::type
47         >    list;
48         test_rcu_int<list>();
49     }
50     void IntrusiveMichaelListHeaderTest::RCU_GPB_base_ic()
51     {
52         typedef base_int_item< RCU > item;
53         typedef ci::MichaelList< RCU
54             ,item
55             ,ci::michael_list::make_traits<
56                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
57                 ,co::less< less<item> >
58                 ,co::compare< cmp<item> >
59                 ,ci::opt::disposer< faked_disposer >
60                 ,co::item_counter< cds::atomicity::item_counter >
61             >::type
62         >    list;
63         test_rcu_int<list>();
64     }
65     void IntrusiveMichaelListHeaderTest::RCU_GPB_member_cmp()
66     {
67         typedef member_int_item< RCU > item;
68         typedef ci::MichaelList< RCU
69             ,item
70             ,ci::michael_list::make_traits<
71                 ci::opt::hook< ci::michael_list::member_hook<
72                     offsetof( item, hMember ),
73                     co::gc<RCU>
74                 > >
75                 ,co::compare< cmp<item> >
76                 ,ci::opt::disposer< faked_disposer >
77             >::type
78         >    list;
79         test_rcu_int<list>();
80     }
81     void IntrusiveMichaelListHeaderTest::RCU_GPB_member_less()
82     {
83         typedef member_int_item< RCU > item;
84         typedef ci::MichaelList< RCU
85             ,item
86             ,ci::michael_list::make_traits<
87                 ci::opt::hook< ci::michael_list::member_hook<
88                     offsetof( item, hMember ),
89                     co::gc<RCU>
90                 > >
91                 ,co::less< less<item> >
92                 ,ci::opt::disposer< faked_disposer >
93             >::type
94         >    list;
95         test_rcu_int<list>();
96     }
97     void IntrusiveMichaelListHeaderTest::RCU_GPB_member_cmpmix()
98     {
99         typedef member_int_item< RCU > item;
100         typedef ci::MichaelList< RCU
101             ,item
102             ,ci::michael_list::make_traits<
103                 ci::opt::hook< ci::michael_list::member_hook<
104                     offsetof( item, hMember ),
105                     co::gc<RCU>
106                 > >
107                 ,co::less< less<item> >
108                 ,co::compare< cmp<item> >
109                 ,ci::opt::disposer< faked_disposer >
110             >::type
111         >    list;
112         test_rcu_int<list>();
113     }
114     void IntrusiveMichaelListHeaderTest::RCU_GPB_member_ic()
115     {
116         typedef member_int_item< RCU > item;
117         typedef ci::MichaelList< RCU
118             ,item
119             ,ci::michael_list::make_traits<
120                 ci::opt::hook< ci::michael_list::member_hook<
121                     offsetof( item, hMember ),
122                     co::gc<RCU>
123                 > >
124                 ,co::compare< cmp<item> >
125                 ,ci::opt::disposer< faked_disposer >
126                 ,co::item_counter< cds::atomicity::item_counter >
127             >::type
128         >    list;
129         test_rcu_int<list>();
130     }
131
132 }