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 "list/hdr_intrusive_lazy.h"
32 #include <cds/urcu/general_buffered.h>
33 #include <cds/intrusive/lazy_list_rcu.h>
37 typedef cds::urcu::gc< cds::urcu::general_buffered<> > RCU;
40 void IntrusiveLazyListHeaderTest::RCU_GPB_base_cmp()
42 typedef base_int_item< RCU > item;
43 typedef ci::lazy_list::make_traits<
44 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
45 ,co::compare< cmp<item> >
46 ,ci::opt::disposer< faked_disposer >
48 typedef ci::LazyList< RCU, item, list_traits > list;
52 void IntrusiveLazyListHeaderTest::RCU_GPB_base_less()
54 typedef base_int_item< RCU > item;
55 typedef ci::LazyList< RCU
57 ,ci::lazy_list::make_traits<
58 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
59 ,co::less< less<item> >
60 ,ci::opt::disposer< faked_disposer >
65 void IntrusiveLazyListHeaderTest::RCU_GPB_base_cmpmix()
67 typedef base_int_item< RCU > item;
68 typedef ci::LazyList< RCU
70 ,ci::lazy_list::make_traits<
71 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
72 ,co::less< less<item> >
73 ,co::compare< cmp<item> >
74 ,ci::opt::disposer< faked_disposer >
79 void IntrusiveLazyListHeaderTest::RCU_GPB_base_ic()
81 typedef base_int_item< RCU > item;
82 typedef ci::LazyList< RCU
84 ,ci::lazy_list::make_traits<
85 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
86 ,co::less< less<item> >
87 ,co::compare< cmp<item> >
88 ,ci::opt::disposer< faked_disposer >
89 ,co::item_counter< cds::atomicity::item_counter >
94 void IntrusiveLazyListHeaderTest::RCU_GPB_member_cmp()
96 typedef member_int_item< RCU > item;
97 typedef ci::LazyList< RCU
99 ,ci::lazy_list::make_traits<
100 ci::opt::hook< ci::lazy_list::member_hook<
101 offsetof( item, hMember ),
104 ,co::compare< cmp<item> >
105 ,ci::opt::disposer< faked_disposer >
108 test_rcu_int<list>();
110 void IntrusiveLazyListHeaderTest::RCU_GPB_member_less()
112 typedef member_int_item< RCU > item;
113 typedef ci::LazyList< RCU
115 ,ci::lazy_list::make_traits<
116 ci::opt::hook< ci::lazy_list::member_hook<
117 offsetof( item, hMember ),
120 ,co::less< less<item> >
121 ,ci::opt::disposer< faked_disposer >
124 test_rcu_int<list>();
126 void IntrusiveLazyListHeaderTest::RCU_GPB_member_cmpmix()
128 typedef member_int_item< RCU > item;
129 typedef ci::LazyList< RCU
131 ,ci::lazy_list::make_traits<
132 ci::opt::hook< ci::lazy_list::member_hook<
133 offsetof( item, hMember ),
136 ,co::less< less<item> >
137 ,co::compare< cmp<item> >
138 ,ci::opt::disposer< faked_disposer >
141 test_rcu_int<list>();
143 void IntrusiveLazyListHeaderTest::RCU_GPB_member_ic()
145 typedef member_int_item< RCU > item;
146 typedef ci::LazyList< RCU
148 ,ci::lazy_list::make_traits<
149 ci::opt::hook< ci::lazy_list::member_hook<
150 offsetof( item, hMember ),
153 ,co::compare< cmp<item> >
154 ,ci::opt::disposer< faked_disposer >
155 ,co::item_counter< cds::atomicity::item_counter >
158 test_rcu_int<list>();
160 } // namespace ordlist