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

HashGenerator Class Reference

This class generates an arbitrary hash number from a sequence of ints. More...

#include <hashGenerator.h>

List of all members.

Public Member Functions

 HashGenerator ()
void add_int (int num)
 Adds another integer to the hash so far.

void add_string (const string &str)
 Adds a string to the hash, by breaking it down into a sequence of integers.

unsigned long get_hash () const
 Returns the hash number generated.


Private Attributes

long _hash
int _index
PrimeNumberGenerator _primes


Detailed Description

This class generates an arbitrary hash number from a sequence of ints.

Definition at line 37 of file hashGenerator.h.


Constructor & Destructor Documentation

HashGenerator::HashGenerator  ) 
 

Definition at line 44 of file hashGenerator.cxx.

References _hash, _index, _primes, max_prime_numbers, and nassertv.


Member Function Documentation

void HashGenerator::add_int int  num  ) 
 

Adds another integer to the hash so far.

Definition at line 58 of file hashGenerator.cxx.

Referenced by DCClass::DCClass(), DCFile::get_num_classes(), and DCMolecularField::write().

void HashGenerator::add_string const string &  str  ) 
 

Adds a string to the hash, by breaking it down into a sequence of integers.

Definition at line 75 of file hashGenerator.cxx.

References _hash.

Referenced by DCClass::DCClass().

unsigned long HashGenerator::get_hash  )  const
 

Returns the hash number generated.

Definition at line 92 of file hashGenerator.cxx.


Member Data Documentation

long HashGenerator::_hash [private]
 

Definition at line 47 of file hashGenerator.h.

Referenced by add_string(), and HashGenerator().

int HashGenerator::_index [private]
 

Definition at line 48 of file hashGenerator.h.

Referenced by HashGenerator().

PrimeNumberGenerator HashGenerator::_primes [private]
 

Definition at line 49 of file hashGenerator.h.

Referenced by HashGenerator().


The documentation for this class was generated from the following files:
Generated on Fri May 2 01:41:03 2003 for Direct by doxygen1.3