FXDict

class FXDict

The dictionary class maintains a fast-access hash table of entities indexed by a character string.

Inheritance:


Public Methods

[more] FXDict()
Construct an empty dictionary
[more]FXint size() const
Return the size of the table, including the empty slots
[more]void size(FXint m)
Resize the table to the given size
[more]FXint no() const
Return the total number of entries in the table
[more]void* insert(const FXchar* ky, const void* ptr, FXbool mrk=FALSE)
Insert a new entry into the table given key and mark.
[more]void* replace(const FXchar* ky, const void* ptr, FXbool mrk=FALSE)
Replace data at key, if the entry's mark is less than or equal to the given mark.
[more]void* remove(const FXchar* ky)
Remove data given key
[more]void* find(const FXchar* ky) const
Find data pointer given key
[more]const FXchar* key(FXuint pos) const
Return key at position pos
[more]void* data(FXuint pos) const
return data pointer at position pos
[more]FXbool mark(FXuint pos) const
Return mark flag of entry at position pos
[more]FXint first() const
Return position of first filled slot, or >= total
[more]FXint last() const
Return position of last filled slot or -1
[more]FXint next(FXint pos) const
Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found
[more]FXint prev(FXint pos) const
Return position of previous filled slot in hash table or a -1 if no filled slot was found
[more]void clear()
Clear all entries
[more]virtual ~FXDict()
Destructor

Protected Methods

[more]virtual void* createData(const void*)
Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer
[more]virtual void deleteData(void*)
Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing


Inherited from FXObject:

Public Methods

oconst FXchar* getClassName() const
oFXbool isMemberOf(const FXMetaClass* metaclass) const
ovirtual void save(FXStream& store) const
ovirtual void load(FXStream& store)


Documentation

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.
ovirtual void* createData(const void*)
Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer

ovirtual void deleteData(void*)
Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing

o FXDict()
Construct an empty dictionary

oFXint size() const
Return the size of the table, including the empty slots

ovoid size(FXint m)
Resize the table to the given size

oFXint no() const
Return the total number of entries in the table

ovoid* insert(const FXchar* ky, const void* ptr, FXbool 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.

ovoid* replace(const FXchar* ky, const void* ptr, FXbool 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.

ovoid* remove(const FXchar* ky)
Remove data given key

ovoid* find(const FXchar* ky) const
Find data pointer given key

oconst FXchar* key(FXuint pos) const
Return key at position pos

ovoid* data(FXuint pos) const
return data pointer at position pos

oFXbool mark(FXuint pos) const
Return mark flag of entry at position pos

oFXint first() const
Return position of first filled slot, or >= total

oFXint last() const
Return position of last filled slot or -1

oFXint next(FXint pos) const
Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found

oFXint prev(FXint pos) const
Return position of previous filled slot in hash table or a -1 if no filled slot was found

ovoid clear()
Clear all entries

ovirtual ~FXDict()
Destructor


Direct child classes:
FXStringDict
FXSettings
FXIconDict
FXFileDict

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.