00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __HASHUTILS_H
00013 #define __HASHUTILS_H
00014
00015 #ifdef HAVE_CONFIG_H
00016 #include <config.h>
00017 #endif
00018
00019 #include <string>
00020
00021 #ifdef HAVE_EXT_HASH_MAP
00022 #include <ext/hash_map>
00023 #include <ext/hash_set>
00024 #else
00025 #include <hash_map>
00026 #include <hash_set>
00027 #endif
00028
00029 #include <Common.h>
00030
00031
00032 using namespace std;
00033
00034 #ifdef HAVE___GNU_CXX__HASH_MAP_INT_INT_
00035 using namespace __gnu_cxx;
00036 #endif
00037
00038
00039 struct _hash_string
00040 {
00041 std::size_t operator()( const std::string &key ) const
00042 {
00043 return hash<const char *>()( key.c_str() );
00044 }
00045 };
00046
00047 struct _hash_NumID
00048 {
00049 std::size_t operator()( const NumID key ) const
00050 {
00051 return key;
00052 }
00053 };
00054
00055 #endif