Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

wvhash.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * Common hash functions for use with wvscatterhash.h and wvhashtable.h.
00006  */
00007 #ifndef __WVHASH_H
00008 #define __WVHASH_H
00009 
00010 #include "wvstring.h"
00011 
00012 // predefined hashing functions (note: string hashes are case-insensitive)
00013 unsigned WvHash(WvStringParm s);
00014 unsigned WvHash(const char *s);
00015 unsigned WvHash(const int &i);
00016 
00017 
00018 // Default comparison function used by WvHashTable
00019 template <class K>
00020 struct OpEqComp
00021 {
00022     static bool compare(const K *key1, const K *key2)
00023         { return *key1 == *key2; }
00024 };
00025 
00026 
00027 // Case-insensitive comparison function for WvHashTable
00028 template <class K>
00029 struct StrCaseComp
00030 {
00031     static bool compare(const K *key1, const K *key2)
00032         { return strcasecmp(*key1, *key2) == 0; }
00033 };
00034 
00035 #endif // __WVHASH_H

Generated on Sun Jul 10 15:30:56 2005 for WvStreams by  doxygen 1.4.0