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

FX::FXHash Class Reference

A hash table for mapping pointers to pointers. More...

#include <FXHash.h>

Inheritance diagram for FX::FXHash:
FX::FXHashOf< KEYTYPE, VALUETYPE >

List of all members.

Classes

struct  Entry

Public Member Functions

 FXHash ()
 Construct empty hash table.
 FXHash (const FXHash &other)
 Construct from another table.
FXival no () const
 Return the total number of slots in the table.
FXival used () const
 Return number of used slots in the table.
FXival free () const
 Return number of free slots in the table.
FXbool empty () const
 See if hash table is empty.
FXHashoperator= (const FXHash &other)
 Assign from another table.
FXHashadopt (FXHash &other)
 Adopt table from another; the other table becomes empty.
FXival find (FXptr name) const
 Find position of given key, returning -1 if not found.
FXptr & at (FXptr name)
 Return reference to slot assocated with given key.
const FXptr & at (FXptr name) const
 Return constant reference to slot assocated with given key.
FXptr & operator[] (FXptr name)
 Return reference to slot assocated with given key.
const FXptr & operator[] (FXptr name) const
 Return constant reference to slot assocated with given key.
FXptr insert (FXptr name, FXptr data=NULL)
 Replace key in table, overwriting the old value if the given key already exists.
FXptr remove (FXptr name)
 Remove key from the table.
FXptr erase (FXival pos)
 Erase entry from table at pos, returning old value.
FXbool empty (FXival pos) const
 Return true if slot is not occupied by a key.
FXptr key (FXival pos) const
 Return key at position pos.
FXptr & value (FXival pos)
 Return reference to data pointer at position pos.
const FXptr & value (FXival pos) const
 Return constant reference data pointer at position pos.
void clear ()
 Clear hash table.
 ~FXHash ()
 Destructor.

Protected Member Functions

FXbool no (FXival n)
void used (FXival u)
void free (FXival f)
FXbool resize (FXival n)

Protected Attributes

Entrytable

Detailed Description

A hash table for mapping pointers to pointers.

Any value may be used as a key, except 0 and -1.


Member Function Documentation

FXptr FX::FXHash::insert ( FXptr  name,
FXptr  data = NULL 
)
inline

Replace key in table, overwriting the old value if the given key already exists.

Returns the old value of the key.

FXptr FX::FXHash::remove ( FXptr  name)

Remove key from the table.

Returns the old value of the key.


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

Copyright © 1997-2016 Jeroen van der Zijp