containers::Hash< T, KeyT > Class Template Reference

Hash and comparaison class. More...

#include <hashlist.h>

List of all members.

Public Member Functions

virtual ~Hash ()
 Destructor.
virtual int compare (KeyT const &key, T const &value) const =0
 Compares a value against a key.
virtual uint32_t hash (KeyT const &key, uint32_t max) const =0
 Hash the given key.
virtual bool match (KeyT const &key, T const &value) const =0
 Determines whether a key matches a value.


Detailed Description

template<class T, class KeyT>
class containers::Hash< T, KeyT >

This class is used in conjunction with the HashList class to determine the hash values of and compare or match a value against arbitrary keys.

You can't use this class directly; instead, create a derived class and override the compare(), hash() and match() functions.

Parameters:
T The type of value in the hash list.
KeyT The type of the key.


Member Function Documentation

template<class T, class KeyT>
virtual int containers::Hash< T, KeyT >::compare KeyT const &  key,
T const &  value
const [pure virtual]
 

Compares a value against the given key.

Parameters:
[in] key The key which must be compared to the value.
[in] value The value.
Returns:
-1, 0 or 1 if the value is respectively less than, equal to, or greater than the key.

template<class T, class KeyT>
virtual uint32_t containers::Hash< T, KeyT >::hash KeyT const &  key,
uint32_t  max
const [pure virtual]
 

Hash the given key.

Parameters:
[in] key The key to hash.
[in] max The number of potential different hash this function can return.
Returns:
The hash of the given key, which must be in the 0..max-1 range.

template<class T, class KeyT>
virtual bool containers::Hash< T, KeyT >::match KeyT const &  key,
T const &  value
const [pure virtual]
 

Determines whether a key matches the given value.

Parameters:
[in] key The key to match the value against.
[in] value The value.
Returns:
true if the the value and key match, false otherwise.


The documentation for this class was generated from the following file:
Generated on Sun May 20 21:32:19 2007 for Epona API by  doxygen 1.4.6