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_lazy.h"
32 #include <cds/container/lazy_list_nogc.h>
36 struct NOGC_cmp_traits : public cc::lazy_list::traits
38 typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
39 static const bool sort = false;
42 void LazyListTestHeader::NOGC_cmp_unord()
44 // traits-based version
45 typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmp_traits > list;
46 nogc_unord_test< list >();
48 // option-based version
49 typedef cc::LazyList< cds::gc::nogc, item,
50 cc::lazy_list::make_traits<
51 cc::opt::compare< cmp<item> >
55 nogc_unord_test< opt_list >();
59 struct NOGC_less_traits : public cc::lazy_list::traits
61 typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
62 static const bool sort = false;
65 void LazyListTestHeader::NOGC_less_unord()
67 // traits-based version
68 typedef cc::LazyList< cds::gc::nogc, item, NOGC_less_traits > list;
69 nogc_unord_test< list >();
71 // option-based version
72 typedef cc::LazyList< cds::gc::nogc, item,
73 cc::lazy_list::make_traits<
74 cc::opt::less< lt<item> >
78 nogc_unord_test< opt_list >();
82 struct NOGC_equal_to_traits : public cc::lazy_list::traits
84 typedef LazyListTestHeader::equal_to<LazyListTestHeader::item> equal_to;
85 static const bool sort = false;
88 void LazyListTestHeader::NOGC_equal_to_unord()
90 // traits-based version
91 typedef cc::LazyList< cds::gc::nogc, item, NOGC_equal_to_traits > list;
92 nogc_unord_test< list >();
94 // option-based version
95 typedef cc::LazyList< cds::gc::nogc, item,
96 cc::lazy_list::make_traits<
97 cc::opt::equal_to< equal_to<item> >
101 nogc_unord_test< opt_list >();
105 struct NOGC_cmpmix_traits : public cc::lazy_list::traits
107 typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
108 typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
109 static const bool sort = false;
112 void LazyListTestHeader::NOGC_cmpmix_unord()
114 // traits-based version
115 typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmpmix_traits > list;
116 nogc_unord_test< list >();
118 // option-based version
119 typedef cc::LazyList< cds::gc::nogc, item,
120 cc::lazy_list::make_traits<
121 cc::opt::compare< cmp<item> >
122 ,cc::opt::less< lt<item> >
123 ,cc::opt::sort<false>
126 nogc_unord_test< opt_list >();
130 struct NOGC_equal_to_mix_traits : public cc::lazy_list::traits
132 typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
133 typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
134 typedef LazyListTestHeader::equal_to<LazyListTestHeader::item> equal_to;
135 static const bool sort = false;
138 void LazyListTestHeader::NOGC_equal_to_mix_unord()
140 // traits-based version
141 typedef cc::LazyList< cds::gc::nogc, item, NOGC_equal_to_mix_traits > list;
142 nogc_unord_test< list >();
144 // option-based version
145 typedef cc::LazyList< cds::gc::nogc, item,
146 cc::lazy_list::make_traits<
147 cc::opt::compare< cmp<item> >
148 ,cc::opt::less< lt<item> >
149 ,cc::opt::equal_to< equal_to<item> >
150 ,cc::opt::sort<false>
153 nogc_unord_test< opt_list >();
156 struct NOGC_ic_traits : public cc::lazy_list::traits
158 typedef LazyListTestHeader::equal_to<LazyListTestHeader::item> equal_to;
159 typedef cds::atomicity::item_counter item_counter;
160 static const bool sort = false;
163 void LazyListTestHeader::NOGC_ic_unord()
165 // traits-based version
166 typedef cc::LazyList< cds::gc::nogc, item, NOGC_ic_traits > list;
167 nogc_unord_test< list >();
169 // option-based version
170 typedef cc::LazyList< cds::gc::nogc, item,
171 cc::lazy_list::make_traits<
172 cc::opt::equal_to< equal_to<item> >
173 ,cc::opt::item_counter< cds::atomicity::item_counter >
174 ,cc::opt::sort<false>
177 nogc_unord_test< opt_list >();
180 } // namespace ordlist