3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HashSummator Class Reference

The class used to calculate hash value over the any type. Usually it is used to check if some structure state changed.
. More...

#include <haser.h>

Detailed Description

The class used to calculate hash value over the any type. Usually it is used to check if some structure state changed.
.

Uncomment the HASHDEBUG if you want to find the reason why hash changes when it should not.

In this case HashSummator will gather history of hash changes in HashSummator::History. You may find on what step hash starts to differ from the previous one. Then you should set breakpoint in the HashSummator::_add(const double& d) and stop when History reaches the reuired count. You will see the reason of changes in the callstack.

The main properties:
1) Small changes of input parameters lead to the small change of the hash value.
2) It may not be directly casted to any other type (for safety), you may add values and compare if it is same or different from other hash summ.
HashSummator::ToDouble() generally converts hash to the double value. It may be used for low space cost of hash storing.

Example:

HashStorage H;
H.add(1,2.0,"string);
H << 23 << x;
if(H != OldHash){
//... hash changed, do something ...
OldHash = H;
}

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