![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
A hash table for associating pointers to pointers. More...
#include <FXHash.h>
Classes | |
| struct | Entry |
Public Member Functions | |
| FXHash () | |
| Construct empty hash table. | |
| FXbool | size (FXuint m) |
| Resize the table to the given size; the size must be a power of two. | |
| FXuint | size () const |
| Return the total number of slots in the table. | |
| FXuint | no () const |
| Return number of non-empty slots in the table. | |
| void * | insert (void *name, void *data=NULL) |
| Insert key into table, unless the key already exists. | |
| void * | replace (void *name, void *data=NULL) |
| Replace key in table, overwriting the old value if the given key already exists. | |
| void * | remove (void *name) |
| Remove key from the table. | |
| void * | find (void *name) const |
| Return value of key, or return NULL. | |
| FXbool | empty (FXuint pos) const |
| Return true if slot is not occupied by a key. | |
| void * | key (FXuint pos) const |
| Return key at position pos. | |
| void * | value (FXuint pos) const |
| Return data pointer at position pos. | |
| void | clear () |
| Clear hash table. | |
| virtual | ~FXHash () |
| Destructor. | |
Protected Attributes | |
| FXArray< Entry > | table |
| FXuint | used |
| FXuint | free |
Static Protected Attributes | |
| static const Entry | init |
A hash table for associating pointers to pointers.
All values may be used as a key, except 0 and -1.
| void* FX::FXHash::insert | ( | void * | name, |
| void * | data = NULL |
||
| ) |
Insert key into table, unless the key already exists.
Returns the current 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::replace | ( | void * | name, |
| void * | data = NULL |
||
| ) |
Replace key in table, overwriting the old value if the given key already exists.
Returns the old value of the key.
|
|