cHasher Class Reference

Utility class to calculate the "fingerprint" of a simulation. More...

#include <chasher.h>

Inheritance diagram for cHasher:
noncopyable

List of all members.

Public Member Functions

 cHasher ()
Updating the hash

void reset ()
void add (const char *p, size_t length)
void add (char d)
void add (short d)
void add (int d)
void add (long d)
void add (opp_long_long d)
void add (unsigned char d)
void add (unsigned short d)
void add (unsigned int d)
void add (unsigned long d)
void add (opp_unsigned_long_long d)
void add (double d)
void add (const char *s)
Obtaining the result

uint32 getHash () const
uint32 parse (const char *fingerprint) const
bool equals (const char *fingerprint) const
std::string str () const

Detailed Description

Utility class to calculate the "fingerprint" of a simulation.

We are trying to achieve that the same simulation gives the same fingerprint on a 32-bit machine and on a 64-bit machine. Longs can be either 32-bit or 64-bit, so we always convert them to 64 bits. We do not try to convert endianness, it would be too costly.


Member Function Documentation

uint32 cHasher::parse ( const char *  fingerprint  )  const

Converts the given string to a numeric fingerprint value.

The object is not changed. Throws an error if the string does not contain a valid fingerprint.


The documentation for this class was generated from the following file:
Generated on Tue Dec 2 11:16:28 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3