Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Hash Class Reference

This class represents a hash value of a map. More...

#include <hash.h>

List of all members.

Public Methods

 Hash (Map const &map)
 Hash (Map const &map, std::vector< int > const &positions)
 Hash (Hash const &other_hash)
 ~Hash ()
Hash & operator= (Hash const &other_hash)
bool operator== (Hash const &other_hash) const
bool operator!= (Hash const &other_hash) const
bool operator< (Hash const &other_hash) const

Private Methods

void calcHash (Map const &map, std::vector< int > const &positions)
bool onHeap () const

Private Attributes

Q_UINT32 m_data0
Hash:: { ... }  rest


Detailed Description

This class represents a hash value of a map.

Note that unlike a real hash, it always allows you to differentiate between different states of the same map.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1
See also:
Map


Constructor & Destructor Documentation

Hash::Hash Map const & map
 

Constructs the hash.

Parameters:
map   The map for the hash.

Hash::Hash Map const & map,
std::vector< int > const & positions
 

Constructs the hash.

The positions in the given vector are used in the hash calculation. Note that the vector holds the indices of all nonwall, nonoutside and nondeadlock fields, the result is equivalent to that of the normal hash function, if the vector is sorted.

Parameters:
map   The map for the hash.
positions   A vector with the indices of the relevant positions.

Hash::Hash Hash const & other_hash
 

The copy constructor.

Parameters:
other_hash   The hash to copy.

Hash::~Hash
 

Releasy the resources.


Member Function Documentation

void Hash::calcHash Map const & map,
std::vector< int > const & positions
[private]
 

Calculates the actual hash value.

Parameters:
map   The map for the hash.
positions   A vector with the indices of the relevant positions.

bool Hash::onHeap const [private]
 

Returns true, if we have allocated on the heap.

bool Hash::operator!= Hash const & other_hash const
 

True if the two hashs are not the same.

Parameters:
other_hash   The hash to compare. Must be of the same map as this hash.

bool Hash::operator< Hash const & other_hash const
 

Used for associative containers.

Parameters:
other_hash   The hash to compare. Must be of the same map as this hash.

Hash& Hash::operator= Hash const & other_hash
 

Copies a hash.

Parameters:
other_hash   The hash to copie. Must be of the same map as this hash.

bool Hash::operator== Hash const & other_hash const
 

True if the two hashs are the same.

Parameters:
other_hash   The hash to compare. Must be of the same map as this hash.


Member Data Documentation

Q_UINT32 Hash::m_data0 [private]
 

If the LSB is set, we use the freestore.

union { ... } Hash::rest [private]
 

The union used to store the pieces.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:10 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001