![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXDict.h>
Public Member Functions | |
FXDict () | |
FXDict (const FXDict &orig) | |
FXDict & | operator= (const FXDict &orig) |
void | size (FXint m) |
FXint | size () const |
FXint | no () const |
void * | insert (const FXchar *ky, const void *ptr, bool mrk=false) |
void * | replace (const FXchar *ky, const void *ptr, bool mrk=false) |
void * | remove (const FXchar *ky) |
void * | find (const FXchar *ky) const |
bool | empty (FXint pos) const |
const FXchar * | key (FXuint pos) const |
void * | data (FXuint pos) const |
bool | mark (FXuint pos) const |
FXint | first () const |
FXint | last () const |
FXint | next (FXint pos) const |
FXint | prev (FXint pos) const |
void | clear () |
virtual | ~FXDict () |
![]() | |
virtual long | onDefault (FXObject *, FXSelector, void *) |
const FXchar * | getClassName () const |
bool | isMemberOf (const FXMetaClass *metaclass) const |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
virtual void | save (FXStream &store) const |
virtual void | load (FXStream &store) |
virtual | ~FXObject () |
The dictionary class maintains a fast-access hash table of entities indexed by a character string.
It is typically used to map strings to pointers; however, overloading the createData() and deleteData() members allows any type of data to be indexed by strings.
FX::FXDict::FXDict | ( | ) |
Construct an empty dictionary.
FX::FXDict::FXDict | ( | const FXDict & | orig | ) |
Copy constructor; does bit-copy of void pointer data.
|
virtual |
Destructor.
void FX::FXDict::size | ( | FXint | m | ) |
Resize the table to the given size.
|
inline |
Return the size of the table, including the empty slots.
|
inline |
Return the total number of entries in the table.
void* FX::FXDict::insert | ( | const FXchar * | ky, |
const void * | ptr, | ||
bool | mrk = false |
||
) |
Insert a new entry into the table given key and mark.
If there is already an entry with that key, leave it unchanged, otherwise insert the new entry.
Referenced by FX::FXStringDict::insert(), and FX::FXIconDict::insert().
void* FX::FXDict::replace | ( | const FXchar * | ky, |
const void * | ptr, | ||
bool | mrk = false |
||
) |
Replace data at key, if the entry's mark is less than or equal to the given mark.
If there was no existing entry, a new entry is inserted with the given mark.
Referenced by FX::FXStringDict::replace().
void* FX::FXDict::remove | ( | const FXchar * | ky | ) |
Remove data given key.
Referenced by FX::FXStringDict::remove(), and FX::FXIconDict::remove().
void* FX::FXDict::find | ( | const FXchar * | ky | ) | const |
Find data pointer given key.
Referenced by FX::FXStringDict::find(), FX::FXSettings::find(), and FX::FXIconDict::find().
|
inline |
Return true if slot is empty.
|
inline |
return data pointer at position pos.
Referenced by FX::FXSettings::data().
|
inline |
Return mark flag of entry at position pos.
FXint FX::FXDict::first | ( | ) | const |
Return position of first filled slot, or >= total.
FXint FX::FXDict::last | ( | ) | const |
Return position of last filled slot or -1.
Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found.
Return position of previous filled slot in hash table or a -1 if no filled slot was found.
void FX::FXDict::clear | ( | ) |
Clear all entries.
![]() |