moab
moab::Hash Class Reference

List of all members.

Public Member Functions

 Hash ()
 Hash (const unsigned char *bytes, size_t len)
 Hash (bool duh)
 Hash (const Hash &src)
Hashoperator= (const Hash &src)
bool operator< (const Hash &other) const

Public Attributes

unsigned long value

Detailed Description

Definition at line 42 of file ReadVtk.cpp.


Constructor & Destructor Documentation

moab::Hash::Hash ( ) [inline]

Definition at line 47 of file ReadVtk.cpp.

    {
    this->value = 5381L;
    }
moab::Hash::Hash ( const unsigned char *  bytes,
size_t  len 
) [inline]

Definition at line 51 of file ReadVtk.cpp.

    { // djb2, a hash by dan bernstein presented on comp.lang.c for hashing strings.
    this->value = 5381L;
    for ( ; len ; -- len, ++ bytes )
      this->value = this->value * 33 + ( *bytes );
    }
moab::Hash::Hash ( bool  duh) [inline]

Definition at line 57 of file ReadVtk.cpp.

    {
    this->value = duh; // hashing a single bit with a long is stupid but easy.
    }
moab::Hash::Hash ( const Hash src) [inline]

Definition at line 61 of file ReadVtk.cpp.

    {
    this->value = src.value;
    }

Member Function Documentation

bool moab::Hash::operator< ( const Hash other) const [inline]

Definition at line 70 of file ReadVtk.cpp.

    {
    return this->value < other.value;
    }
Hash& moab::Hash::operator= ( const Hash src) [inline]

Definition at line 65 of file ReadVtk.cpp.

    {
    this->value = src.value;
    return *this;
    }

Member Data Documentation

unsigned long moab::Hash::value

Definition at line 45 of file ReadVtk.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines