HashClasses.h

00001 /****************************************************************************
00002  * Copyright 2005 Evan Drumwright
00003  * This library is distributed under the terms of the GNU General Public 
00004  * License (found in COPYING).
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 } // end namespace Physsim
00030 #endif

Generated on Wed Oct 24 14:54:21 2007 for Physsim by  doxygen 1.5.1