Panda3D
|
This is a specific kind of HashGenerator that simply adds up all of the ints. More...
#include "checksumHashGenerator.h"
Public Member Functions | |
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_int (long num) |
Adds another integer to the hash so far. | |
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. |
This is a specific kind of HashGenerator that simply adds up all of the ints.
Nothing fancy, and pretty quick.
Definition at line 28 of file checksumHashGenerator.h.
void ChecksumHashGenerator::add_bool | ( | bool | flag | ) | [inline] |
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 46 of file checksumHashGenerator.I.
References add_int().
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 58 of file checksumHashGenerator.I.
References add_int().
void ChecksumHashGenerator::add_int | ( | long | sum | ) | [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 24 of file checksumHashGenerator.I.
Referenced by add_bool(), add_fp(), add_pointer(), add_string(), BitMask< WType, nbits >::generate_hash(), and BitArray::generate_hash().
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 70 of file checksumHashGenerator.I.
References add_int().
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 24 of file checksumHashGenerator.cxx.
References add_int().