|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Class for holding and calculation of checksum value of objects. More...
#include <FFaCheckSum.H>
Public Member Functions | |
| FFaCheckSum () | |
| The default constructor initializes crc32_table. More... | |
| FFaCheckSum (const FFaCheckSum &)=delete | |
| The default copy constructor is deleted. More... | |
| ~FFaCheckSum () | |
| The destructor deletes the heap-allocated member crc32_table. More... | |
| FFaCheckSum & | operator= (const FFaCheckSum &cs) |
| Assignment operator. More... | |
| bool | operator== (const FFaCheckSum &cs) const |
| Equality operator,. More... | |
| void | reset () |
| Initializes checksum and addval. More... | |
| unsigned int | getCurrent () const |
| Returns the current checksum value. More... | |
| void | add (const std::string &e) |
| Adds the checksum of a std::string value to checksum. More... | |
| void | add (char e) |
| Adds the checksum of a char value to checksum. More... | |
| void | add (unsigned char e) |
| Adds the checksum of an unsigned char value to checksum. More... | |
| void | add (short int e) |
| Adds the checksum of a short int value to checksum. More... | |
| void | add (unsigned short int e) |
| Adds the checksum of an unsigned short int value to checksum. More... | |
| void | add (int e) |
| Adds the checksum of an int value to checksum. More... | |
| void | add (unsigned int e) |
| Adds the checksum of an unsigned int value to checksum. More... | |
| void | add (float e) |
| Adds the checksum of a float value to checksum. More... | |
| void | add (double e, int precision=0) |
| Adds the checksum of a double value to checksum. More... | |
| void | add (const FaVec3 &e, int precision=0) |
| Adds the checksum of a FaVec3 value to checksum. More... | |
| template<class T > | |
| void | add (const std::vector< T > &v) |
| Adds the checksum of a std::vector value to checksum. More... | |
Private Member Functions | |
| unsigned int | doCRC (unsigned int data) |
| Calculates the checksum value of a variable casted to unsigned int. More... | |
Private Attributes | |
| unsigned int * | crc32_table |
| 32-bit Cyclic Redundancy Check hashing values More... | |
| unsigned int | checksum |
| Current checksum value. More... | |
| unsigned int | addval |
| Incremented and added to data on each doCRC() call. More... | |
| bool | isBigEndian |
| Determines the Endianness of the computer. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const FFaCheckSum &cs) |
| Printing operator. More... | |
| std::istream & | operator>> (std::istream &s, FFaCheckSum &cs) |
| Reading operator. More... | |
Class for holding and calculation of checksum value of objects.
The checksum calculation is based on a CRC32 (32-bit Cyclic Redundancy Check) algorithm.
| FFaCheckSum::FFaCheckSum | ( | ) |
The default constructor initializes crc32_table.
|
delete |
The default copy constructor is deleted.
|
inline |
The destructor deletes the heap-allocated member crc32_table.
|
inline |
Adds the checksum of a char value to checksum.
| void FFaCheckSum::add | ( | const FaVec3 & | e, |
| int | precision = 0 |
||
| ) |
|
inline |
Adds the checksum of a std::string value to checksum.
|
inline |
Adds the checksum of a std::vector value to checksum.
| void FFaCheckSum::add | ( | double | e, |
| int | precision = 0 |
||
| ) |
Adds the checksum of a double value to checksum.
If precision > 0, the value e is rounded to precision significant digits, and the checksum is calculated from the mantissa and exponent separately and then added together. Otherwise (if precision is zero), the last two bytes (7th and 8th) of the double word e is omitted from the checksum calculation.
| void FFaCheckSum::add | ( | float | e | ) |
Adds the checksum of a float value to checksum.
The last (4th) byte of the float word e containing the least significant digits is omitted from the checksum calculation.
|
inline |
Adds the checksum of an int value to checksum.
|
inline |
Adds the checksum of a short int value to checksum.
|
inline |
Adds the checksum of an unsigned char value to checksum.
|
inline |
Adds the checksum of an unsigned int value to checksum.
|
inline |
Adds the checksum of an unsigned short int value to checksum.
|
private |
Calculates the checksum value of a variable casted to unsigned int.
|
inline |
Returns the current checksum value.
| FFaCheckSum & FFaCheckSum::operator= | ( | const FFaCheckSum & | cs | ) |
Assignment operator.
| bool FFaCheckSum::operator== | ( | const FFaCheckSum & | cs | ) | const |
Equality operator,.
|
friend |
Printing operator.
|
friend |
Reading operator.
|
private |
Incremented and added to data on each doCRC() call.
|
private |
Current checksum value.
|
private |
32-bit Cyclic Redundancy Check hashing values
|
private |
Determines the Endianness of the computer.