Move libcds 1.6.0 from SVN
[libcds.git] / tests / test-hdr / set / hdr_intrusive_michael_set_rcu_shb.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_set.h"
4 #include <cds/urcu/signal_buffered.h>
5 #include <cds/intrusive/michael_list_rcu.h>
6 #include <cds/intrusive/michael_set_rcu.h>
7
8 namespace set {
9
10 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
11     namespace {
12         typedef cds::urcu::gc< cds::urcu::signal_buffered<> >   RCU;
13     }
14 #endif
15
16     void IntrusiveHashSetHdrTest::RCU_SHB_base_cmp()
17     {
18 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
19         typedef base_int_item< ci::michael_list::node<RCU> > item;
20         typedef ci::MichaelList< RCU
21             ,item
22             ,ci::michael_list::make_traits<
23                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
24                 ,co::compare< cmp<item> >
25                 ,ci::opt::disposer< faked_disposer >
26             >::type
27         >    bucket_type;
28
29         typedef ci::MichaelHashSet< RCU, bucket_type,
30             ci::michael_set::make_traits<
31                 co::hash< hash_int >
32             >::type
33         > set;
34
35         test_rcu_int<set>();
36 #endif
37     }
38
39     void IntrusiveHashSetHdrTest::RCU_SHB_base_less()
40     {
41 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
42         typedef base_int_item< ci::michael_list::node<RCU> > item;
43         typedef ci::MichaelList< RCU
44             ,item
45             ,ci::michael_list::make_traits<
46                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
47                 ,co::less< less<item> >
48                 ,ci::opt::disposer< faked_disposer >
49             >::type
50         >    bucket_type;
51
52         typedef ci::MichaelHashSet< RCU, bucket_type,
53             ci::michael_set::make_traits<
54                 co::hash< hash_int >
55             >::type
56         > set;
57
58         test_rcu_int<set>();
59 #endif
60     }
61
62     void IntrusiveHashSetHdrTest::RCU_SHB_base_cmpmix()
63     {
64 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
65         typedef base_int_item< ci::michael_list::node<RCU> > item;
66         typedef ci::MichaelList< RCU
67             ,item
68             ,ci::michael_list::make_traits<
69                 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
70                 ,co::less< less<item> >
71                 ,co::compare< cmp<item> >
72                 ,ci::opt::disposer< faked_disposer >
73             >::type
74         >    bucket_type;
75
76         typedef ci::MichaelHashSet< RCU, bucket_type,
77             ci::michael_set::make_traits<
78                 co::hash< hash_int >
79                 ,co::item_counter< simple_item_counter >
80             >::type
81         > set;
82
83         test_rcu_int<set>();
84 #endif
85     }
86
87     void IntrusiveHashSetHdrTest::RCU_SHB_member_cmp()
88     {
89 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
90         typedef member_int_item< ci::michael_list::node<RCU> > item;
91         typedef ci::MichaelList< RCU
92             ,item
93             ,ci::michael_list::make_traits<
94                 ci::opt::hook< ci::michael_list::member_hook<
95                     offsetof( item, hMember ),
96                     co::gc<RCU>
97                 > >
98                 ,co::compare< cmp<item> >
99                 ,ci::opt::disposer< faked_disposer >
100             >::type
101         >    bucket_type;
102
103         typedef ci::MichaelHashSet< RCU, bucket_type,
104             ci::michael_set::make_traits<
105                 co::hash< hash_int >
106             >::type
107         > set;
108
109         test_rcu_int<set>();
110 #endif
111     }
112
113     void IntrusiveHashSetHdrTest::RCU_SHB_member_less()
114     {
115 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
116         typedef member_int_item< ci::michael_list::node<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::less< less<item> >
125                 ,ci::opt::disposer< faked_disposer >
126             >::type
127         >    bucket_type;
128
129         typedef ci::MichaelHashSet< RCU, bucket_type,
130             ci::michael_set::make_traits<
131                 co::hash< hash_int >
132             >::type
133         > set;
134
135         test_rcu_int<set>();
136 #endif
137     }
138
139     void IntrusiveHashSetHdrTest::RCU_SHB_member_cmpmix()
140     {
141 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
142         typedef member_int_item< ci::michael_list::node<RCU> > item;
143         typedef ci::MichaelList< RCU
144             ,item
145             ,ci::michael_list::make_traits<
146                 ci::opt::hook< ci::michael_list::member_hook<
147                     offsetof( item, hMember ),
148                     co::gc<RCU>
149                 > >
150                 ,co::compare< cmp<item> >
151                 ,co::less< less<item> >
152                 ,ci::opt::disposer< faked_disposer >
153             >::type
154         >    bucket_type;
155
156         typedef ci::MichaelHashSet< RCU, bucket_type,
157             ci::michael_set::make_traits<
158                 co::hash< hash_int >
159                 ,co::item_counter< simple_item_counter >
160             >::type
161         > set;
162
163         test_rcu_int<set>();
164 #endif
165     }
166
167
168 } // namespace set