3 #include "set/hdr_set.h"
4 #include <cds/container/lazy_list_hrc.h>
5 #include <cds/container/michael_set.h>
10 struct set_traits: public cc::michael_set::type_traits
12 typedef HashSetHdrTest::hash_int hash;
13 typedef HashSetHdrTest::simple_item_counter item_counter;
16 struct HRC_cmp_traits: public cc::lazy_list::type_traits
18 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
21 struct HRC_less_traits: public cc::lazy_list::type_traits
23 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
26 struct HRC_cmpmix_traits: public cc::lazy_list::type_traits
28 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
29 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
33 void HashSetHdrTest::Lazy_HRC_cmp()
35 typedef cc::LazyList< cds::gc::HRC, item, HRC_cmp_traits > list;
37 // traits-based version
38 typedef cc::MichaelHashSet< cds::gc::HRC, list, set_traits > set;
41 // option-based version
42 typedef cc::MichaelHashSet< cds::gc::HRC, list,
43 cc::michael_set::make_traits<
44 cc::opt::hash< hash_int >
45 ,cc::opt::item_counter< simple_item_counter >
48 test_int< opt_set >();
51 void HashSetHdrTest::Lazy_HRC_less()
53 typedef cc::LazyList< cds::gc::HRC, item, HRC_less_traits > list;
55 // traits-based version
56 typedef cc::MichaelHashSet< cds::gc::HRC, list, set_traits > set;
59 // option-based version
60 typedef cc::MichaelHashSet< cds::gc::HRC, list,
61 cc::michael_set::make_traits<
62 cc::opt::hash< hash_int >
63 ,cc::opt::item_counter< simple_item_counter >
66 test_int< opt_set >();
69 void HashSetHdrTest::Lazy_HRC_cmpmix()
71 typedef cc::LazyList< cds::gc::HRC, item, HRC_cmpmix_traits > list;
73 // traits-based version
74 typedef cc::MichaelHashSet< cds::gc::HRC, list, set_traits > set;
77 // option-based version
78 typedef cc::MichaelHashSet< cds::gc::HRC, list,
79 cc::michael_set::make_traits<
80 cc::opt::hash< hash_int >
81 ,cc::opt::item_counter< simple_item_counter >
84 test_int< opt_set >();