3 #include "set/hdr_set.h"
4 #include <cds/container/lazy_list_hrc.h>
5 #include <cds/container/split_list_set.h>
10 struct HRC_cmp_traits: public cc::split_list::type_traits
12 typedef cc::lazy_list_tag ordered_list;
13 typedef HashSetHdrTest::hash_int hash;
14 typedef HashSetHdrTest::simple_item_counter item_counter;
15 typedef cc::opt::v::relaxed_ordering memory_model;
16 enum { dynamic_bucket_table = false };
18 struct ordered_list_traits: public cc::lazy_list::type_traits
20 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
24 struct HRC_less_traits: public cc::split_list::type_traits
26 typedef cc::lazy_list_tag ordered_list;
27 typedef HashSetHdrTest::hash_int hash;
28 typedef HashSetHdrTest::simple_item_counter item_counter;
29 typedef cc::opt::v::sequential_consistent memory_model;
30 enum { dynamic_bucket_table = false };
32 struct ordered_list_traits: public cc::lazy_list::type_traits
34 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
38 struct HRC_cmpmix_traits: public cc::split_list::type_traits
40 typedef cc::lazy_list_tag ordered_list;
41 typedef HashSetHdrTest::hash_int hash;
42 typedef HashSetHdrTest::simple_item_counter item_counter;
44 struct ordered_list_traits: public cc::lazy_list::type_traits
46 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
47 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
52 void HashSetHdrTest::Split_Lazy_HRC_cmp()
54 // traits-based version
55 typedef cc::SplitListSet< cds::gc::HRC, item, HRC_cmp_traits > set;
59 // option-based version
60 typedef cc::SplitListSet< cds::gc::HRC, item,
61 cc::split_list::make_traits<
62 cc::split_list::ordered_list<cc::lazy_list_tag>
63 ,cc::opt::hash< hash_int >
64 ,cc::opt::item_counter< simple_item_counter >
65 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
66 ,cc::split_list::dynamic_bucket_table< true >
67 ,cc::split_list::ordered_list_traits<
68 cc::lazy_list::make_traits<
69 cc::opt::compare< cmp<item> >
74 test_int< opt_set >();
77 void HashSetHdrTest::Split_Lazy_HRC_less()
79 // traits-based version
80 typedef cc::SplitListSet< cds::gc::HRC, item, HRC_less_traits > set;
84 // option-based version
85 typedef cc::SplitListSet< cds::gc::HRC, item,
86 cc::split_list::make_traits<
87 cc::split_list::ordered_list<cc::lazy_list_tag>
88 ,cc::opt::hash< hash_int >
89 ,cc::opt::item_counter< simple_item_counter >
90 ,cc::opt::memory_model< cc::opt::v::sequential_consistent >
91 ,cc::split_list::dynamic_bucket_table< false >
92 ,cc::split_list::ordered_list_traits<
93 cc::lazy_list::make_traits<
94 cc::opt::less< less<item> >
99 test_int< opt_set >();
102 void HashSetHdrTest::Split_Lazy_HRC_cmpmix()
104 // traits-based version
105 typedef cc::SplitListSet< cds::gc::HRC, item, HRC_cmpmix_traits > set;
108 // option-based version
109 typedef cc::SplitListSet< cds::gc::HRC, item,
110 cc::split_list::make_traits<
111 cc::split_list::ordered_list<cc::lazy_list_tag>
112 ,cc::opt::hash< hash_int >
113 ,cc::opt::item_counter< simple_item_counter >
114 ,cc::split_list::ordered_list_traits<
115 cc::lazy_list::make_traits<
116 cc::opt::less< less<item> >
117 ,cc::opt::compare< cmp<item> >
122 test_int< opt_set >();