00001
00002
00003
00004
00005
00006
00007 #ifndef _HASH_CLASSES_H
00008 #define _HASH_CLASSES_H
00009
00010 #include <string>
00011 #include <ext/hash_map>
00012
00013 namespace Physsim {
00014
00016 class StringHash
00017 {
00018 public:
00019 size_t operator()(const std::string s) const { __gnu_cxx::hash<const char*> H; return H(s.c_str()); }
00020 };
00021
00023 class StringEqual
00024 {
00025 public:
00026 bool operator()(const std::string s1, const std::string s2) const { return strcasecmp(s1.c_str(), s2.c_str()) == 0; }
00027 };
00028
00029 }
00030 #endif