2 This file is a part of libcds - Concurrent Data Structures library
4 (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
6 Source code repo: http://github.com/khizmax/libcds/
7 Download: http://sourceforge.net/projects/libcds/files/
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 this list of conditions and the following disclaimer in the documentation
17 and/or other materials provided with the distribution.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "set/hdr_intrusive_set.h"
32 #include <cds/urcu/general_buffered.h>
33 #include <cds/intrusive/michael_list_rcu.h>
34 #include <cds/intrusive/michael_set_rcu.h>
39 typedef cds::urcu::gc< cds::urcu::general_buffered<> > RCU;
42 void IntrusiveHashSetHdrTest::RCU_GPB_base_cmp()
44 typedef base_int_item< ci::michael_list::node<RCU> > item;
45 typedef ci::MichaelList< RCU
47 ,ci::michael_list::make_traits<
48 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
49 ,co::compare< cmp<item> >
50 ,ci::opt::disposer< faked_disposer >
54 typedef ci::MichaelHashSet< RCU, bucket_type,
55 ci::michael_set::make_traits<
60 test_rcu_int_michael_list<set>();
63 void IntrusiveHashSetHdrTest::RCU_GPB_base_less()
65 typedef base_int_item< ci::michael_list::node<RCU> > item;
66 typedef ci::MichaelList< RCU
68 ,ci::michael_list::make_traits<
69 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
70 ,co::less< less<item> >
71 ,ci::opt::disposer< faked_disposer >
75 typedef ci::MichaelHashSet< RCU, bucket_type,
76 ci::michael_set::make_traits<
81 test_rcu_int_michael_list<set>();
84 void IntrusiveHashSetHdrTest::RCU_GPB_base_cmpmix()
86 typedef base_int_item< ci::michael_list::node<RCU> > item;
87 typedef ci::MichaelList< RCU
89 ,ci::michael_list::make_traits<
90 ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
91 ,co::less< less<item> >
92 ,co::compare< cmp<item> >
93 ,ci::opt::disposer< faked_disposer >
97 typedef ci::MichaelHashSet< RCU, bucket_type,
98 ci::michael_set::make_traits<
100 ,co::item_counter< simple_item_counter >
104 test_rcu_int_michael_list<set>();
107 void IntrusiveHashSetHdrTest::RCU_GPB_member_cmp()
109 typedef member_int_item< ci::michael_list::node<RCU> > item;
110 typedef ci::MichaelList< RCU
112 ,ci::michael_list::make_traits<
113 ci::opt::hook< ci::michael_list::member_hook<
114 offsetof( item, hMember ),
117 ,co::compare< cmp<item> >
118 ,ci::opt::disposer< faked_disposer >
122 typedef ci::MichaelHashSet< RCU, bucket_type,
123 ci::michael_set::make_traits<
128 test_rcu_int_michael_list<set>();
131 void IntrusiveHashSetHdrTest::RCU_GPB_member_less()
133 typedef member_int_item< ci::michael_list::node<RCU> > item;
134 typedef ci::MichaelList< RCU
136 ,ci::michael_list::make_traits<
137 ci::opt::hook< ci::michael_list::member_hook<
138 offsetof( item, hMember ),
141 ,co::less< less<item> >
142 ,ci::opt::disposer< faked_disposer >
146 typedef ci::MichaelHashSet< RCU, bucket_type,
147 ci::michael_set::make_traits<
152 test_rcu_int_michael_list<set>();
155 void IntrusiveHashSetHdrTest::RCU_GPB_member_cmpmix()
157 typedef member_int_item< ci::michael_list::node<RCU> > item;
158 typedef ci::MichaelList< RCU
160 ,ci::michael_list::make_traits<
161 ci::opt::hook< ci::michael_list::member_hook<
162 offsetof( item, hMember ),
165 ,co::compare< cmp<item> >
166 ,co::less< less<item> >
167 ,ci::opt::disposer< faked_disposer >
171 typedef ci::MichaelHashSet< RCU, bucket_type,
172 ci::michael_set::make_traits<
174 ,co::item_counter< simple_item_counter >
178 test_rcu_int_michael_list<set>();