00001
00002
00003 #ifndef HASH_MAP_H
00004 #define HASH_MAP_H
00005
00006 #include "osl/stl/hash.h"
00007 #include "osl/stl/pool_allocator.h"
00008 #if (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)
00009 # include <tr1/unordered_map>
00010 #else
00011 # include <ext/hash_map>
00012 #endif
00013
00014 namespace osl
00015 {
00016 namespace stl
00017 {
00018 template <class T>
00019 struct hash;
00020
00021 #if (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)
00022 template<class Key, class Value, class HashFun=hash<Key>,
00023 class EqualKey=std::equal_to<Key> >
00024 struct hash_map
00025 : public std::tr1::unordered_map<Key, Value, HashFun, EqualKey,
00026 pool_allocator<std::pair<const Key, Value> > >
00027 {
00028 typedef std::tr1::unordered_map<Key, Value, HashFun, EqualKey,
00029 pool_allocator<std::pair<const Key, Value> > > base_t;
00030 hash_map() {}
00031 hash_map(size_t s) : base_t(s)
00032 {
00033 }
00034 ~hash_map();
00035 };
00036 template<class Key, class Value, class HashFun, class EqualKey>
00037 hash_map<Key,Value,HashFun,EqualKey>::~hash_map()
00038 {
00039 }
00040 #else
00041 template<class Key, class Value, class HashFun=osl::stl::hash<Key>,
00042 class EqualKey=std::equal_to<Key> >
00043 struct hash_map
00044 : public __gnu_cxx::hash_map<Key, Value, HashFun, EqualKey,
00045 pool_allocator<Value> >
00046 {
00047 typedef __gnu_cxx::hash_map<Key, Value, HashFun, EqualKey,
00048 pool_allocator<Value> > base_t;
00049 hash_map() {}
00050 hash_map(size_t s) : base_t(s)
00051 {
00052 }
00053 };
00054 #endif
00055 }
00056 using stl::hash_map;
00057 }
00058
00059
00060 #endif
00061
00062
00063
00064