e985cdc3cc778a4978f952479c9188a367d74b46
[libcds.git] / tests / test-hdr / ordered_list / hdr_intrusive_michael_list_rcu_gpi.cpp
1 //$$CDS-header$$
2
3 #include "ordered_list/hdr_intrusive_michael.h"
4 #include <cds/urcu/general_instant.h>
5 #include <cds/intrusive/michael_list_rcu.h>
6
7 namespace ordlist {
8     namespace {
9         typedef cds::urcu::gc< cds::urcu::general_instant<> >    RCU;
10     }
11
12     void IntrusiveMichaelListHeaderTest::RCU_GPI_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_GPI_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_GPI_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_GPI_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_GPI_member_cmp()
66     {
67         typedef member_int_item< RCU > item;
68         struct traits: public 
69             ci::michael_list::make_traits<
70                 ci::opt::hook< ci::michael_list::member_hook<
71                     offsetof( item, hMember ),
72                     co::gc<RCU>
73                 > >
74                 ,co::compare< cmp<item> >
75                 ,ci::opt::disposer< faked_disposer >
76             >::type
77         {};
78         typedef ci::MichaelList< RCU, item, traits > list;
79         test_rcu_int<list>();
80     }
81     void IntrusiveMichaelListHeaderTest::RCU_GPI_member_less()
82     {
83         typedef member_int_item< RCU > item;
84         struct traits: public 
85             ci::michael_list::make_traits<
86                 ci::opt::hook< ci::michael_list::member_hook<
87                     offsetof( item, hMember ),
88                     co::gc<RCU>
89                 > >
90                 ,co::less< less<item> >
91                 ,ci::opt::disposer< faked_disposer >
92             >::type
93         {};
94         typedef ci::MichaelList< RCU, item, traits > list;
95         test_rcu_int<list>();
96     }
97     void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmpmix()
98     {
99         typedef member_int_item< RCU > item;
100         struct traits: public 
101             ci::michael_list::make_traits<
102                 ci::opt::hook< ci::michael_list::member_hook<
103                     offsetof( item, hMember ),
104                     co::gc<RCU>
105                 > >
106                 ,co::less< less<item> >
107                 ,co::compare< cmp<item> >
108                 ,ci::opt::disposer< faked_disposer >
109             >::type
110         {};
111         typedef ci::MichaelList< RCU, item, traits > list;
112         test_rcu_int<list>();
113     }
114     void IntrusiveMichaelListHeaderTest::RCU_GPI_member_ic()
115     {
116         typedef member_int_item< RCU > item;
117         struct traits: public 
118             ci::michael_list::make_traits<
119                 ci::opt::hook< ci::michael_list::member_hook<
120                     offsetof( item, hMember ),
121                     co::gc<RCU>
122                 > >
123                 ,co::compare< cmp<item> >
124                 ,ci::opt::disposer< faked_disposer >
125                 ,co::item_counter< cds::atomicity::item_counter >
126             >::type
127         {};
128         typedef ci::MichaelList< RCU, item, traits > list;
129         test_rcu_int<list>();
130     }
131 } // namespace ordlist