intrusive MultiLevelHashSet:
[libcds.git] / tests / test-hdr / set / hdr_intrusive_multilevel_hashset_hp.cpp
1 //$$CDS-header$$
2
3 #include "set/hdr_intrusive_multilevel_hashset.h"
4 #include <cds/intrusive/multilevel_hashset_hp.h>
5 #include "unit/print_multilevel_hashset_stat.h"
6
7 namespace set {
8     namespace {
9         typedef cds::gc::HP gc_type;
10     } // namespace
11
12     void IntrusiveMultiLevelHashSetHdrTest::hp_stdhash()
13     {
14         typedef size_t hash_type;
15
16         struct traits: public ci::multilevel_hashset::traits
17         {
18             typedef get_hash<hash_type> hash_accessor;
19             typedef item_disposer disposer;
20         };
21         typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
22         test_hp<set_type>();
23
24         typedef ci::MultiLevelHashSet< 
25             gc_type, 
26             Item<hash_type>, 
27             typename ci::multilevel_hashset::make_traits<
28                 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
29                 , ci::opt::disposer< item_disposer >
30             >::type
31         > set_type2;
32         test_hp<set_type2>();
33     }
34
35     void IntrusiveMultiLevelHashSetHdrTest::hp_stdhash_stat()
36     {
37         typedef size_t hash_type;
38
39         struct traits: public ci::multilevel_hashset::traits
40         {
41             typedef get_hash<hash_type> hash_accessor;
42             typedef item_disposer disposer;
43             typedef ci::multilevel_hashset::stat<> stat;
44         };
45         typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
46         test_hp<set_type>();
47
48         typedef ci::MultiLevelHashSet< 
49             gc_type, 
50             Item<hash_type>, 
51             typename ci::multilevel_hashset::make_traits<
52                 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
53                 , ci::opt::disposer< item_disposer >
54                 ,co::stat< ci::multilevel_hashset::stat<>>
55             >::type
56         > set_type2;
57         test_hp<set_type2>();
58     }
59
60 } // namespace set
61
62 CPPUNIT_TEST_SUITE_REGISTRATION(set::IntrusiveMultiLevelHashSetHdrTest);