Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

hashcomp.h

Go to the documentation of this file.
00001 /*       +------------------------------------+
00002  *       | Inspire Internet Relay Chat Daemon |
00003  *       +------------------------------------+
00004  *
00005  *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
00006  *                       E-mail:
00007  *                <brain@chatspike.net>
00008  *                <Craig@chatspike.net>
00009  *
00010  * Written by Craig Edwards, Craig McLure, and others.
00011  * This program is free but copyrighted software; see
00012  *            the file COPYING for details.
00013  *
00014  * ---------------------------------------------------
00015  */
00016 
00017 #ifndef _HASHCOMP_H_
00018 #define _HASHCOMP_H_
00019 
00020 #include "inspircd_config.h"
00021 
00022 #ifdef GCC3
00023 #include <ext/hash_map>
00024 #else
00025 #include <hash_map>
00026 #endif
00027 
00028 #ifdef GCC3
00029 #define nspace __gnu_cxx
00030 #else
00031 #define nspace std
00032 #endif
00033 
00034 using namespace std;
00035 
00036 namespace nspace
00037 {
00038 #ifdef GCC34
00039         template<> struct hash<in_addr>
00040 #else
00041         template<> struct nspace::hash<in_addr>
00042 #endif
00043         {
00044                 size_t operator()(const struct in_addr &a) const;
00045         };
00046 #ifdef GCC34
00047         template<> struct hash<string>
00048 #else
00049         template<> struct nspace::hash<string>
00050 #endif
00051         {
00052                 size_t operator()(const string &s) const;
00053         };
00054 }
00055 
00058 namespace irc
00059 {
00060 
00065         struct StrHashComp
00066         {
00069                 bool operator()(const std::string& s1, const std::string& s2) const;
00070         };
00071 
00072 
00077         struct InAddr_HashComp
00078         {
00081                 bool operator()(const in_addr &s1, const in_addr &s2) const;
00082         };
00083 
00084 
00089         struct irc_char_traits : std::char_traits<char> {
00090 
00093                 static bool eq(char c1st, char c2nd);
00094 
00097                 static bool ne(char c1st, char c2nd);
00098 
00101                 static bool lt(char c1st, char c2nd);
00102 
00105                 static int compare(const char* str1, const char* str2, size_t n);
00106 
00109                 static const char* find(const char* s1, int  n, char c);
00110         };
00111 
00114         typedef basic_string<char, irc_char_traits, allocator<char> > string;
00115 }
00116 
00117 #endif

Generated on Sun May 15 18:36:01 2005 for InspIRCd by doxygen 1.3.3