hash_map.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hash_map.h
Go to the documentation of this file.
1 /* hash_map.h
2 */
3 #ifndef HASH_MAP_H
4 #define HASH_MAP_H
5
6 #include "osl/stl/hash.h"
7 #include "osl/stl/pool_allocator.h"
8 #if (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)
9 # include <tr1/unordered_map>
10 #else
11 # include <boost/unordered_map.hpp>
12 #endif
13 #include <cstddef>
14 namespace osl
15 {
16 namespace stl
17 {
18 template <class T>
19 struct hash;
20
21 #if (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)
22 template<class Key, class Value, class HashFun=osl::stl::hash<Key>,
23 class EqualKey=std::equal_to<Key>,
24 class Alloc=pool_allocator<std::pair<const Key, Value> > >
25 struct hash_map
26 : public std::tr1::unordered_map<Key, Value, HashFun, EqualKey,
27 Alloc>
28 {
29 typedef std::tr1::unordered_map<Key, Value, HashFun, EqualKey,
30 Alloc> base_t;
31 hash_map() {}
32 hash_map(size_t s) : base_t(s)
33 {
34 }
35 ~hash_map();
36 };
37 template<class Key, class Value, class HashFun, class EqualKey, class Alloc>
38 hash_map<Key,Value,HashFun,EqualKey,Alloc>::~hash_map()
39 {
40 }
41
42 #else
43 template<class Key, class Value, class HashFun=osl::stl::hash<Key>,
44 class EqualKey=std::equal_to<Key>, class Alloc=pool_allocator<std::pair<const Key, Value> > >
45 struct hash_map
46 : public boost::unordered_map<Key, Value, HashFun, EqualKey, Alloc>
47 {
48 typedef boost::unordered_map<Key, Value, HashFun, EqualKey,
49 Alloc> base_t;
50 hash_map() {}
51 hash_map(size_t s) : base_t(s)
52 {
53 }
54 ~hash_map();
55 };
56 template<class Key, class Value, class HashFun, class EqualKey, class Alloc>
57 hash_map<Key,Value,HashFun,EqualKey,Alloc>::~hash_map()
58 {
59 }
60 #endif
61 } // namespace stl
62 using stl::hash_map;
63 } // namespace stl
64
65
66 #endif /* HASH_MAP_H */
67 // ;;; Local Variables:
68 // ;;; mode:c++
69 // ;;; c-basic-offset:2
70 // ;;; End: