Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PHashTable Class Reference

#include <dict.h>

Inheritance diagram for PHashTable:

PCollection PContainer PObject PAbstractDictionary PAbstractSet

List of all members.


Detailed Description

The hash table class is the basis for implementing the PSet# and PDictionary# classes.

The hash table allows for very fast searches for an object based on a "hash function". This function yields an index into an array which is directly looked up to locate the object. When two key values have the same hash function value, then a linear search of a linked list is made to locate the object. Thus the efficiency of the hash table is highly dependent on the quality of the hash function for the data being used as keys.

Definition at line 260 of file dict.h.


I/O functions

ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)
virtual void ReadFrom (istream &strm)

Comparison functions

virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

Public Member Functions

PINDEX AppendElement (PObject *key, PObject *data)
virtual void DestroyContents ()
Element * GetElementAt (const PObject &key)
PINDEX GetElementsIndex (const PObject *obj, BOOL byVal, BOOL keys) const
PObjectRemoveElement (const PObject &key)
BOOL SetLastElementAt (PINDEX index)
Common functions for collections
PINLINE void AllowDeleteObjects (BOOL yes=TRUE)
virtual PINDEX Append (PObject *obj)=0
void DisallowDeleteObjects ()
virtual PObjectGetAt (PINDEX index) const =0
virtual PINDEX GetObjectsIndex (const PObject *obj) const =0
virtual PINDEX GetValuesIndex (const PObject &obj) const =0
virtual PINDEX Insert (const PObject &before, PObject *obj)=0
virtual PINDEX InsertAt (PINDEX index, PObject *obj)=0
virtual BOOL Remove (const PObject *obj)=0
virtual void RemoveAll ()
virtual PObjectRemoveAt (PINDEX index)=0
virtual BOOL SetAt (PINDEX index, PObject *val)=0
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const
Overrides from class PObject
virtual Comparison Compare (const PObject &obj) const
Common functions for containers
virtual PINDEX GetSize () const
virtual BOOL IsEmpty () const
BOOL IsUnique () const
virtual BOOL MakeUnique ()
BOOL SetMinSize (PINDEX minSize)
Construction
 PHashTable ()
 Create a new, empty, hash table.
Overrides from class PObject
virtual void PrintOn (ostream &strm) const

Public Attributes

BOOL deleteKeys
PINDEX lastBucket
Element * lastElement
PINDEX lastIndex

Protected Member Functions

virtual void AssignContents (const PContainer &c)
void CloneContents (const PContainer *src)
void CopyContents (const PContainer &c)
void Destruct ()
New functions for class
PINLINE BOOL AbstractContains (const PObject &key) const
virtual PObjectAbstractGetDataAt (PINDEX index) const
virtual const PObjectAbstractGetKeyAt (PINDEX index) const
Overrides from class PContainer
virtual BOOL SetSize (PINDEX newSize)

Protected Attributes

class PContainer::Reference * reference

Private Member Functions

 PCONTAINERINFO (PHashTable, PCollection)

Friends

class PAbstractSet
class PHashTable

Classes

class  Element

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index