3 #include "map/hdr_map.h"
4 #include <cds/container/lazy_list_hp.h>
5 #include <cds/container/split_list_map.h>
10 struct HP_cmp_traits: public cc::split_list::type_traits
12 typedef cc::lazy_list_tag ordered_list;
13 typedef HashMapHdrTest::hash_int hash;
14 typedef HashMapHdrTest::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 HashMapHdrTest::cmp compare;
24 struct HP_less_traits: public cc::split_list::type_traits
26 typedef cc::lazy_list_tag ordered_list;
27 typedef HashMapHdrTest::hash_int hash;
28 typedef HashMapHdrTest::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 HashMapHdrTest::less less;
38 struct HP_cmpmix_traits: public cc::split_list::type_traits
40 typedef cc::lazy_list_tag ordered_list;
41 typedef HashMapHdrTest::hash_int hash;
42 typedef HashMapHdrTest::simple_item_counter item_counter;
44 struct ordered_list_traits: public cc::lazy_list::type_traits
46 typedef HashMapHdrTest::cmp compare;
47 typedef std::less<HashMapHdrTest::key_type> less;
52 void HashMapHdrTest::Split_Lazy_HP_cmp()
54 // traits-based version
55 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type;
56 test_int< map_type >();
58 // option-based version
59 typedef cc::SplitListMap< cds::gc::HP,
62 cc::split_list::make_traits<
63 cc::split_list::ordered_list<cc::lazy_list_tag>
64 ,cc::opt::hash< hash_int >
65 ,cc::opt::item_counter< simple_item_counter >
66 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
67 ,cc::split_list::dynamic_bucket_table< true >
68 ,cc::split_list::ordered_list_traits<
69 cc::lazy_list::make_traits<
70 cc::opt::compare< cmp >
75 test_int< opt_map >();
78 void HashMapHdrTest::Split_Lazy_HP_less()
80 // traits-based version
81 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type;
82 test_int< map_type >();
84 // option-based version
85 typedef cc::SplitListMap< cds::gc::HP,
88 cc::split_list::make_traits<
89 cc::split_list::ordered_list<cc::lazy_list_tag>
90 ,cc::opt::hash< hash_int >
91 ,cc::opt::item_counter< simple_item_counter >
92 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
93 ,cc::split_list::dynamic_bucket_table< true >
94 ,cc::split_list::ordered_list_traits<
95 cc::lazy_list::make_traits<
101 test_int< opt_map >();
104 void HashMapHdrTest::Split_Lazy_HP_cmpmix()
106 // traits-based version
107 typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type;
108 test_int< map_type >();
110 // option-based version
111 typedef cc::SplitListMap< cds::gc::HP,
114 cc::split_list::make_traits<
115 cc::split_list::ordered_list<cc::lazy_list_tag>
116 ,cc::opt::hash< hash_int >
117 ,cc::opt::item_counter< simple_item_counter >
118 ,cc::split_list::ordered_list_traits<
119 cc::lazy_list::make_traits<
120 cc::opt::less< std::less<key_type> >
121 ,cc::opt::compare< cmp >
126 test_int< opt_map >();