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

ChecksumHashGenerator Class Reference

This is a specific kind of HashGenerator that simply adds up all of the ints. More...

#include <checksumHashGenerator.h>

Inheritance diagram for ChecksumHashGenerator:

HashGeneratorBase List of all members.

Public Member Functions

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

void add_bool (bool flag)
 Adds a boolean flag.

void add_fp (float num, float threshold)
 Adds a floating-point number, first converting it to fixed point by dividing it by the indicated threshold.

void add_fp (double num, double threshold)
 Adds a floating-point number, first converting it to fixed point by dividing it by the indicated threshold.

void add_pointer (void *ptr)
 Adds a pointer, derived simply by casting the pointer to an integer.

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

size_t get_hash () const
 Returns the hash number generated.


Protected Attributes

size_t _hash

Detailed Description

This is a specific kind of HashGenerator that simply adds up all of the ints.

Nothing fancy, and pretty quick.

Definition at line 40 of file checksumHashGenerator.h.


Member Function Documentation

void ChecksumHashGenerator::add_bool bool  flag  )  [inline]
 

Adds a boolean flag.

Definition at line 49 of file checksumHashGenerator.I.

References add_int(), and INLINE.

void ChecksumHashGenerator::add_fp double  num,
double  threshold
[inline]
 

Adds a floating-point number, first converting it to fixed point by dividing it by the indicated threshold.

Definition at line 83 of file checksumHashGenerator.I.

void ChecksumHashGenerator::add_fp float  num,
float  threshold
[inline]
 

Adds a floating-point number, first converting it to fixed point by dividing it by the indicated threshold.

Definition at line 66 of file checksumHashGenerator.I.

References add_int(), and INLINE.

void ChecksumHashGenerator::add_int int  num  )  [inline]
 

Adds another integer to the hash so far.

This function should be overridden in base classes; this is the principle implementation of the HashGenerator.

Definition at line 36 of file checksumHashGenerator.I.

References INLINE.

Referenced by add_bool(), add_fp(), and BitMask< WordType, num_bits >::operator|().

void ChecksumHashGenerator::add_pointer void *  ptr  )  [inline]
 

Adds a pointer, derived simply by casting the pointer to an integer.

This should be good enough even on architectures for which this cast is lossy.

Definition at line 100 of file checksumHashGenerator.I.

void ChecksumHashGenerator::add_string const string &  str  ) 
 

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

Definition at line 35 of file checksumHashGenerator.cxx.

size_t HashGeneratorBase::get_hash  )  const [inline, inherited]
 

Returns the hash number generated.

Definition at line 55 of file hashGeneratorBase.I.


Member Data Documentation

size_t HashGeneratorBase::_hash [protected, inherited]
 

Definition at line 64 of file hashGeneratorBase.h.

Referenced by HashGeneratorBase::~HashGeneratorBase().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:48:16 2003 for Panda by doxygen1.3