00001
00002 #ifndef GAUDIKERNEL_HASHMAP_H
00003 #define GAUDIKERNEL_HASHMAP_H 1
00004
00005
00006 #include "Map.h"
00007 #include "Hash.h"
00008
00009 #if defined(_WIN32) || defined(__ICC) || defined(__ECC)
00010 #include <hash_map>
00011 #elif __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
00012 #include <ext/hash_map>
00013 #elif __GNUC__ >= 4
00014
00015
00016
00017 #include <ext/hash_map>
00018 #endif
00019
00020 namespace GaudiUtils {
00021
00030 template <typename K, typename T,
00031 typename H = Hash<K>,
00032 #if defined(_WIN32)
00033
00034
00035
00036 typename M = std::map<K,T>
00037 #elif defined(__ICC) || defined(__ECC)
00038 typename M = std::hash_map<K,T,H>
00039 #elif __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
00040 typename M = __gnu_cxx::hash_map<K,T,H>
00041 #elif __GNUC__ >= 4
00042
00043
00044 typename M = __gnu_cxx::hash_map<K,T,H>
00045
00046 #endif
00047 >
00048 class HashMap: public Map<K,T,M> {
00049
00050 public:
00051 typedef H hasher;
00052
00053 inline hasher hash_funct() const {
00054
00055
00056 #ifdef _WIN32
00057 return hasher();
00058 #else
00059 return this->m_map.hash_funct();
00060 #endif
00061 }
00062 };
00063 }
00064
00065 #endif // GAUDIKERNEL_GAUDIHASHMAP_H