Panda3D
Public Member Functions | List of all 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

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...
 
- Public Member Functions inherited from HashGeneratorBase
size_t get_hash () const
 Returns the hash number generated. More...
 

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 28 of file checksumHashGenerator.h.

Member Function Documentation

◆ add_bool()

void ChecksumHashGenerator::add_bool ( bool  flag)
inline

Adds a boolean flag.

Definition at line 34 of file checksumHashGenerator.I.

References add_fp(), and add_int().

Referenced by add_int().

◆ add_fp() [1/2]

void ChecksumHashGenerator::add_fp ( float  num,
float  threshold 
)
inline

◆ add_fp() [2/2]

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(), and add_pointer().

◆ add_int()

void ChecksumHashGenerator::add_int ( long  sum)
inline

◆ add_pointer()

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().

Referenced by add_fp().

◆ add_string()

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().


The documentation for this class was generated from the following files: