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 "Map.h"
00007 #include "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
00033 template <typename K, typename T,
00034 typename H = Hash<K>,
00035 #if defined(_WIN32)
00036
00037
00038
00039 typename M = std::map<K,T>
00040 #elif defined(__ECC)
00041 typename M = std::hash_map<K,T,H>
00042 #elif defined(__ICC)
00043
00044 typename M = __gnu_cxx::hash_map<K,T,H>
00045 #elif __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
00046 typename M = __gnu_cxx::hash_map<K,T,H>
00047 #elif __GNUC__ >= 4
00048
00049
00050 typename M = __gnu_cxx::hash_map<K,T,H>
00051
00052 #endif
00053 >
00054 class HashMap: public Map<K,T,M> {
00055
00056 public:
00057 typedef H hasher;
00058
00059 inline hasher hash_funct() const {
00060
00061
00062 #ifdef _WIN32
00063 return hasher();
00064 #else
00065 return this->m_map.hash_funct();
00066 #endif
00067 }
00068 };
00069 }
00070
00071 #endif // GAUDIKERNEL_GAUDIHASHMAP_H