string_hasher Class Reference

Implements a simple hashing algorithm for strings. More...

#include <string_hasher.h>

Inheritance diagram for string_hasher:

Inheritance graph
[legend]
Collaboration diagram for string_hasher:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual u_int hash (const void *key_data, int key_length) const
 returns a value that can be used to index into a hash table.
virtual hashing_algorithmclone () const
 implements cloning of the algorithm object.

Detailed Description

Implements a simple hashing algorithm for strings.

This uses a portion of the string's contents to create a hash value.

Definition at line 24 of file string_hasher.h.


Member Function Documentation

u_int string_hasher::hash ( const void *  key_data,
int  key_length 
) const [virtual]

returns a value that can be used to index into a hash table.

the returned value is loosely based on the "key_data" and the "key_length" we are provided with. it is expected that the "key_data" really is a 'char' pointer whose length is "key_length" (including the zero terminator at the end).

Implements hashing_algorithm.

Definition at line 35 of file string_hasher.cpp.

References MAX_STRING_CHARS_USED, and minimum().

hashing_algorithm * string_hasher::clone (  )  const [virtual]

implements cloning of the algorithm object.

Implements hashing_algorithm.

Definition at line 32 of file string_hasher.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 04:31:02 2008 for HOOPLE Libraries by  doxygen 1.5.1