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

FX::FXHash Class Reference

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

#include <FXHash.h>

List of all members.

Public Member Functions

 FXHash ()
void size (FXuint m)
FXuint size () const
FXuint no () const
void * insert (void *name, void *data)
void * replace (void *name, void *data)
void * remove (void *name)
void * find (void *name) const
FXbool empty (FXuint pos) const
void * key (FXuint pos) const
void * value (FXuint pos) const
void clear ()
virtual ~FXHash ()


Detailed Description

A hash table for associating pointers to pointers.

Constructor & Destructor Documentation

FX::FXHash::FXHash (  ) 

Construct empty hash table.

virtual FX::FXHash::~FXHash (  )  [virtual]

Destructor.


Member Function Documentation

void FX::FXHash::size ( FXuint  m  ) 

Resize the table to the given size; the size must be a power of two.

FXuint FX::FXHash::size (  )  const [inline]

Return the total number of slots in the table.

FXuint FX::FXHash::no (  )  const [inline]

Return number of non-empty slots in the table.

void* FX::FXHash::insert ( void *  name,
void *  data 
)

Insert key into table, unless the key already exists.

Returns the current value of the key.

void* FX::FXHash::replace ( void *  name,
void *  data 
)

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

Returns the old value of the key.

void* FX::FXHash::remove ( void *  name  ) 

Remove key from the table.

Returns the old value of the key.

void* FX::FXHash::find ( void *  name  )  const

Return value of key, or return NULL.

FXbool FX::FXHash::empty ( FXuint  pos  )  const [inline]

Return true if slot is not occupied by a key.

void* FX::FXHash::key ( FXuint  pos  )  const [inline]

Return key at position pos.

void* FX::FXHash::value ( FXuint  pos  )  const [inline]

Return data pointer at position pos.

References FX::FXPath::name(), and NULL.

void FX::FXHash::clear (  ) 

Clear hash table.

Copyright © 1997-2009 Jeroen van der Zijp