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. More... | |
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. More... | |
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. More... | |
void | add_int (long num) |
Adds another integer to the hash so far. More... | |
void | add_pointer (void *ptr) |
Adds a pointer, derived simply by casting the pointer to an integer. More... | |
void | add_string (const string &str) |
Adds a string to the hash, by breaking it down into a sequence of integers. More... | |
![]() | |
size_t | get_hash () const |
Returns the hash number generated. More... | |
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.
|
inline |
Adds a boolean flag.
Definition at line 34 of file checksumHashGenerator.I.
References add_fp(), and add_int().
Referenced by add_int().
|
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().
Referenced by add_bool(), LVecBase2f::generate_hash(), LVecBase3f::generate_hash(), LVecBase4f::generate_hash(), LMatrix3f::generate_hash(), LMatrix4f::generate_hash(), LVecBase2d::generate_hash(), LVecBase3d::generate_hash(), LVecBase4d::generate_hash(), LVecBase2i::generate_hash(), LVecBase3i::generate_hash(), LVecBase4i::generate_hash(), LMatrix3d::generate_hash(), and LMatrix4d::generate_hash().
|
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(), and add_pointer().
|
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.
References add_bool().
Referenced by add_bool(), add_fp(), add_pointer(), add_string(), BitArray::generate_hash(), BitMask< PN_uint32, 32 >::generate_hash(), LVecBase2f::generate_hash(), LVecBase3f::generate_hash(), LVecBase4f::generate_hash(), LVecBase2d::generate_hash(), LVecBase3d::generate_hash(), LVecBase4d::generate_hash(), LVecBase2i::generate_hash(), LVecBase3i::generate_hash(), and LVecBase4i::generate_hash().
|
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().
Referenced by add_fp().
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().