intrusive::MichaelSet refactoring
[libcds.git] / tests / test-hdr / set / hdr_intrusive_michael_set_dhp.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_set.h"
4 #include <cds/intrusive/michael_list_dhp.h>
5 #include <cds/intrusive/michael_set.h>
6
7 namespace set {
8
9     void IntrusiveHashSetHdrTest::DHP_base_cmp()
10     {
11         typedef base_int_item< ci::michael_list::node<cds::gc::DHP> > item;
12         typedef ci::MichaelList< cds::gc::DHP
13             ,item
14             ,ci::michael_list::make_traits<
15                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
16                 ,co::compare< cmp<item> >
17                 ,ci::opt::disposer< faked_disposer >
18             >::type
19         >    bucket_type;
20
21         typedef ci::MichaelHashSet< cds::gc::DHP, bucket_type,
22             ci::michael_set::make_traits<
23                 co::hash< hash_int >
24             >::type
25         > set;
26
27         test_int<set>();
28     }
29
30     void IntrusiveHashSetHdrTest::DHP_base_less()
31     {
32         typedef base_int_item< ci::michael_list::node<cds::gc::DHP> > item;
33         typedef ci::MichaelList< cds::gc::DHP
34             ,item
35             ,ci::michael_list::make_traits<
36                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
37                 ,co::less< less<item> >
38                 ,ci::opt::disposer< faked_disposer >
39             >::type
40         > bucket_type;
41
42         typedef ci::MichaelHashSet< cds::gc::DHP, bucket_type,
43             ci::michael_set::make_traits<
44                 co::hash< hash_int >
45             >::type
46         > set;
47
48         test_int<set>();
49     }
50
51     void IntrusiveHashSetHdrTest::DHP_base_cmpmix()
52     {
53         typedef base_int_item< ci::michael_list::node<cds::gc::DHP> > item;
54         typedef ci::MichaelList< cds::gc::DHP
55             ,item
56             ,ci::michael_list::make_traits<
57                 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
58                 ,co::less< less<item> >
59                 ,co::compare< cmp<item> >
60                 ,ci::opt::disposer< faked_disposer >
61             >::type
62         >    bucket_type;
63
64         typedef ci::MichaelHashSet< cds::gc::DHP, bucket_type,
65             ci::michael_set::make_traits<
66                 co::hash< hash_int >
67                 ,co::item_counter< simple_item_counter >
68             >::type
69         > set;
70
71         test_int<set>();
72     }
73
74     void IntrusiveHashSetHdrTest::DHP_member_cmp()
75     {
76         typedef member_int_item< ci::michael_list::node<cds::gc::DHP> > item;
77         typedef ci::MichaelList< cds::gc::DHP
78             ,item
79             ,ci::michael_list::make_traits<
80                 ci::opt::hook< ci::michael_list::member_hook<
81                     offsetof( item, hMember ),
82                     co::gc<cds::gc::DHP>
83                 > >
84                 ,co::compare< cmp<item> >
85                 ,ci::opt::disposer< faked_disposer >
86             >::type
87         >    bucket_type;
88
89         typedef ci::MichaelHashSet< cds::gc::DHP, bucket_type,
90             ci::michael_set::make_traits<
91                 co::hash< hash_int >
92             >::type
93         > set;
94
95         test_int<set>();
96     }
97
98     void IntrusiveHashSetHdrTest::DHP_member_less()
99     {
100         typedef member_int_item< ci::michael_list::node<cds::gc::DHP> > item;
101         typedef ci::MichaelList< cds::gc::DHP
102             ,item
103             ,ci::michael_list::make_traits<
104                 ci::opt::hook< ci::michael_list::member_hook<
105                     offsetof( item, hMember ),
106                     co::gc<cds::gc::DHP>
107                 > >
108                 ,co::less< less<item> >
109                 ,ci::opt::disposer< faked_disposer >
110             >::type
111         >    bucket_type;
112
113         typedef ci::MichaelHashSet< cds::gc::DHP, bucket_type,
114             ci::michael_set::make_traits<
115                 co::hash< hash_int >
116             >::type
117         > set;
118
119         test_int<set>();
120     }
121
122     void IntrusiveHashSetHdrTest::DHP_member_cmpmix()
123     {
124         typedef member_int_item< ci::michael_list::node<cds::gc::DHP> > item;
125         typedef ci::MichaelList< cds::gc::DHP
126             ,item
127             ,ci::michael_list::make_traits<
128                 ci::opt::hook< ci::michael_list::member_hook<
129                     offsetof( item, hMember ),
130                     co::gc<cds::gc::DHP>
131                 > >
132                 ,co::compare< cmp<item> >
133                 ,co::less< less<item> >
134                 ,ci::opt::disposer< faked_disposer >
135             >::type
136         >    bucket_type;
137
138         typedef ci::MichaelHashSet< cds::gc::DHP, bucket_type,
139             ci::michael_set::make_traits<
140                 co::hash< hash_int >
141                 ,co::item_counter< simple_item_counter >
142             >::type
143         > set;
144
145         test_int<set>();
146     }
147
148
149 } // namespace set