feisty meow concerns codebase  2.140
string_hasher.h
Go to the documentation of this file.
1 #ifndef STRING_HASHER_CLASS
2 #define STRING_HASHER_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : string_hasher *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2001-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include "hash_table.h"
19 
20 namespace structures {
21 
23 
25 class string_hasher : public virtual hashing_algorithm
26 {
27 public:
28  virtual basis::un_int hash(const void *key_data, int key_length) const;
30 
35  virtual hashing_algorithm *clone() const;
37 };
38 
40 
41 class astring_hasher : public virtual hashing_algorithm
42 {
43 public:
44  virtual basis::un_int hash(const void *key_data, int key_length) const;
46 
47  virtual hashing_algorithm *clone() const;
49 };
50 
51 } //namespace.
52 
53 #endif
54 
virtual basis::un_int hash(const void *key_data, int key_length) const
similar to string_hasher, but expects "key_data" as an astring pointer.
virtual hashing_algorithm * clone() const
implements cloning of the algorithm object.
A hashing algorithm takes a key and derives a related integer from it.
Definition: hash_table.h:41
Implements a simple hashing algorithm for strings.
Definition: string_hasher.h:26
virtual basis::un_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_algorithm * clone() const
implements cloning of the algorithm object.
unsigned int un_int
Abbreviated name for unsigned integers.
Definition: definitions.h:62
A dynamic container class that holds any kind of object via pointers.
Definition: amorph.h:55