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

FCInternalHash< Key, ConfigData > Class Template Reference

An templated hash class. More...

#include <FCInternalHash.h>

Inheritance diagram for FCInternalHash< Key, ConfigData >:

AGenericHash< Key, ConfigData > List of all members.

Public Member Functions

 FCInternalHash (int SizeWanted, ACompareNodesAlgorithm< Key, ConfigData > *CompareAlgorithm, AHashAlgorithm< Key > *Hash, DeleteHashDataEnum DeleteHashData=NO_DELETE_HASH_ITEM)
 Constructor.
virtual ~FCInternalHash ()
 Destructor.
Key * Insert (Key *key, bool OptimizeForCaching)
 Insert a value. Don't add if already there.
virtual void DeleteItems ()
 Delete all the items in the hash table.

Protected Member Functions

void Rehash (FCInternalHash< Key, ConfigData > *Hash)
 Increases the size of the hash table, allowing for smaller chains, and faster lookup.
virtual void Copy (AGenericHash< Key, ConfigData > *Hash)
 Copy a FCInternalHash object into this FCInternalHash object.

Private Attributes

FCHashItem< Key > ** m_Entries
 List of Entries in the hash table.

Detailed Description

template<class Key, class ConfigData>
class FCInternalHash< Key, ConfigData >

This class is based off of the Shlomi Fish's (shlomif@vipe.technion.ac.il) implementation of hash functionality written in C

Definition at line 50 of file FCInternalHash.h.


Member Function Documentation

template<class Key, class ConfigData>
void FCInternalHash< Key, ConfigData >::Copy AGenericHash< Key, ConfigData > *  Hash  )  [protected, virtual]
 

Parameters:
Hash is the FCInternalHash object to be copied

Reimplemented from AGenericHash< Key, ConfigData >.

Definition at line 262 of file FCInternalHash.h.

References AGenericHash< Key, ConfigData >::Copy(), and FCInternalHash< Key, ConfigData >::m_Entries.

Referenced by FCInternalHash< Key, ConfigData >::Rehash().

template<class Key, class ConfigData>
Key * FCInternalHash< Key, ConfigData >::Insert Key *  key,
bool  OptimizeForCaching
[virtual]
 

Parameters:
key is the value being inserted
OptimizeForCaching is a flag for caching optimization
Returns:
A pointer to the value inserted/found

Implements AGenericHash< Key, ConfigData >.

Definition at line 144 of file FCInternalHash.h.

References ACompareNodesAlgorithm< Data, ConfigData >::Compare(), AGenericHash< Key, ConfigData >::m_Compare, FCInternalHash< Key, ConfigData >::m_Entries, AGenericHash< Key, ConfigData >::m_Hash, FCHashItem< Key >::m_Key, FCHashItem< Key >::m_Next, AGenericHash< Key, ConfigData >::m_NumberOfElements, AGenericHash< Key, ConfigData >::m_Size, FCHashItem< Key >::m_Value, and FCInternalHash< Key, ConfigData >::Rehash().

Referenced by FCSIndirectTalonStateWithLocations::CacheTalonStacks(), FCSCompactTalonStateWithLocations::CacheTalonStacks(), and FCSDebugTalonStateWithLocations::CacheTalonStacks().

template<class Key, class ConfigData>
void FCInternalHash< Key, ConfigData >::Rehash FCInternalHash< Key, ConfigData > *  Hash  )  [protected]
 

Parameters:
Hash is a hash table being increased

Definition at line 216 of file FCInternalHash.h.

References FCInternalHash< Key, ConfigData >::Copy(), AGenericHash< Key, ConfigData >::m_Compare, AGenericHash< Key, ConfigData >::m_DeleteHashData, FCInternalHash< Key, ConfigData >::m_Entries, AGenericHash< Key, ConfigData >::m_Hash, FCHashItem< Key >::m_Next, AGenericHash< Key, ConfigData >::m_NumberOfElements, AGenericHash< Key, ConfigData >::m_Size, and FCHashItem< Key >::m_Value.

Referenced by FCInternalHash< Key, ConfigData >::Insert().


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 11:20:16 2005 for Cpp Freecell Solver by  doxygen 1.4.4