HashMap.h
Go to the documentation of this file.00001
00002 #ifndef GAUDIKERNEL_HASHMAP_H
00003 #define GAUDIKERNEL_HASHMAP_H 1
00004
00005
00006 #include "GaudiKernel/Map.h"
00007 #include "GaudiKernel/Hash.h"
00008
00009 #if defined(_WIN32) || defined(__ECC)
00010 #include <hash_map>
00011 #elif defined(__ICC)
00012
00013 #include <ext/hash_map>
00014 #elif __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
00015 #include <ext/hash_map>
00016 #elif __GNUC__ >= 4
00017
00018
00019
00020 #include <ext/hash_map>
00021 #endif
00022
00023 namespace GaudiUtils
00024 {
00025
00087 template <typename K, typename T,
00088 typename H = Hash<K>,
00089 #if defined(_WIN32)
00090
00091
00092
00093 typename M = std::map<K,T>
00094 #elif defined(__ECC)
00095 typename M = std::hash_map<K,T,H>
00096 #elif defined(__ICC)
00097
00098 typename M = __gnu_cxx::hash_map<K,T,H>
00099 #elif __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
00100 typename M = __gnu_cxx::hash_map<K,T,H>
00101 #elif __GNUC__ >= 4
00102
00103
00104 typename M = __gnu_cxx::hash_map<K,T,H>
00105
00106 #endif
00107 >
00108 class HashMap: public Map<K,T,M> {
00109
00110 public:
00111 typedef H hasher;
00112
00113 inline hasher hash_funct() const {
00114
00115
00116 #ifdef _WIN32
00117 return hasher();
00118 #else
00119 return this->m_map.hash_funct();
00120 #endif
00121 }
00122 };
00123 }
00124
00125 #endif // GAUDIKERNEL_GAUDIHASHMAP_H