3 // Copyright (C) 2005, 2006 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 2, or (at your option) any later
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this library; see the file COPYING. If not, write to
18 // the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19 // MA 02111-1307, USA.
21 // As a special exception, you may use this file as part of a free
22 // software library without restriction. Specifically, if other files
23 // instantiate templates or use macros or inline functions from this
24 // file, or you compile this file and link it with other files to
25 // produce an executable, this file does not by itself cause the
26 // resulting executable to be covered by the GNU General Public
27 // License. This exception does not however invalidate any other
28 // reasons why the executable file might be covered by the GNU General
31 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
33 // Permission to use, copy, modify, sell, and distribute this software
34 // is hereby granted without fee, provided that the above copyright
35 // notice appears in all copies, and that both that copyright notice
36 // and this permission notice appear in supporting documentation. None
37 // of the above authors, nor IBM Haifa Research Laboratories, make any
38 // representation about the suitability of this software for any
39 // purpose. It is provided "as is" without express or implied
43 * @file multimap_common_type.hpp
44 * Contains types for a generic multimap_insert_test test.
47 #ifndef PB_DS_MULTIMAP_RANDOM_INT_INSERT_TEST_COMMON_TYPE_HPP
48 #define PB_DS_MULTIMAP_RANDOM_INT_INSERT_TEST_COMMON_TYPE_HPP
50 #include <hash_fn/string_hash_fn.hpp>
51 #include <common_type/assoc/common_type.hpp>
62 struct int_hash : public std::unary_function<
67 operator()(const int i) const
69 return (static_cast<size_t>(i));
73 template<typename Key, class Allocator = std::allocator<char> >
77 typename pb_ds::test::hash_common_types<
79 pb_ds::null_mapped_type,
83 Allocator>::performance_min_tl
87 template<typename Key, class Allocator = std::allocator<char> >
91 typename pb_ds::test::lu_common_types<
93 pb_ds::null_mapped_type,
96 Allocator>::performance_min_tl
100 template<typename Key,
102 class Allocator = std::allocator<
104 struct hash_mmap_tl_t
108 typename pb_ds::detail::conditional_type<
109 pb_ds::detail::is_same<
113 string_hash_fn>::type
116 template<typename Cntnr_T>
117 struct hash_mmap_transform
120 typename pb_ds::test::hash_common_types<
126 Allocator>::performance_min_tl
132 typename pb_ds::detail::typelist_flatten<
133 typename pb_ds::detail::typelist_transform<
135 hash_mmap_transform>::type>::type
139 template<typename Key,
141 class Allocator = std::allocator<
143 struct tree_mmap_tl_t
146 template<typename Cntnr_T>
147 struct tree_mmap_transform
150 typename pb_ds::test::tree_common_types<
155 pb_ds::null_tree_node_update,
156 Allocator>::performance_min_tl
162 typename pb_ds::detail::typelist_flatten<
163 typename pb_ds::detail::typelist_transform<
165 tree_mmap_transform>::type>::type
169 template<typename Key, typename Mapped, class Allocator>
170 struct hash_hash_mmap_tl_t
173 typedef typename hash_set_tl_t< Mapped, Allocator>::type sec_tl_t;
176 typedef typename hash_mmap_tl_t< Key, sec_tl_t, Allocator>::type type;
179 template<typename Key, typename Mapped, class Allocator>
180 struct tree_hash_mmap_tl_t
183 typedef typename hash_set_tl_t< Mapped, Allocator>::type sec_tl_t;
186 typedef typename tree_mmap_tl_t< Key, sec_tl_t, Allocator>::type type;
189 template<typename Key, typename Mapped, class Allocator>
190 struct tree_lu_mmap_tl_t
193 typedef typename lu_set_tl_t< Mapped, Allocator>::type sec_tl_t;
196 typedef typename tree_mmap_tl_t< Key, sec_tl_t, Allocator>::type type;
199 template<typename Key, typename Mapped, class Allocator>
200 struct hash_lu_mmap_tl_t
203 typedef typename lu_set_tl_t< Mapped, Allocator>::type sec_tl_t;
206 typedef typename hash_mmap_tl_t< Key, sec_tl_t, Allocator>::type type;
209 } // namespace detail
211 template<typename Key, typename Mapped, class Allocator>
216 typename detail::hash_hash_mmap_tl_t<
223 typename detail::hash_lu_mmap_tl_t<
230 typename detail::tree_hash_mmap_tl_t<
237 typename detail::tree_lu_mmap_tl_t<
245 typename pb_ds::detail::typelist_append<
247 typename pb_ds::detail::typelist_append<
249 typename pb_ds::detail::typelist_append<
251 tl_mmap_tl_t>::type>::type>::type
259 #endif // #ifndef PB_DS_MULTIMAP_RANDOM_INT_INSERT_TEST_COMMON_TYPE_HPP