A template class for a hash map.
More...
#include <linked.h>
|
| void | add (const char *name, T &object) |
| | Add a typed object derived from NamedObject to the hash map by name. More...
|
| |
| void | add (const char *name, T *object) |
| | Add a typed object derived from NamedObject to the hash map by name. More...
|
| |
| T * | begin (void) const |
| | Find first typed object in hash map to iterate. More...
|
| |
| unsigned | count (void) const |
| | Count the number of typed objects in our hash map. More...
|
| |
| T * | get (const char *name) const |
| | Find a typed object derived from NamedObject in the hash map by name. More...
|
| |
| T ** | index (void) const |
| | Convert our hash map into a linear object pointer array. More...
|
| |
| unsigned | limit (void) const |
| | Retrieve key size to use in NamedObject constructors. More...
|
| |
| T * | next (T *current) const |
| | Find next typed object in hash map for iteration. More...
|
| |
| T & | operator[] (const char *name) const |
| | Find a typed object derived from NamedObject in the hash map by name. More...
|
| |
| T * | remove (const char *name) |
| | Remove a typed object derived from NamedObject to the hash map by name. More...
|
| |
| NamedObject ** | root (void) const |
| | Retrieve root of index to use in NamedObject constructors. More...
|
| |
| T ** | sort (void) const |
| | Convert our hash map into an alphabetically sorted linear object pointer array. More...
|
| |
|
| ~keymap () |
| | Destroy the hash map by puring the index chains.
|
| |
template<class T, unsigned M = 177>
class ucommon::keymap< T, M >
A template class for a hash map.
This provides a has map index object as a chain of keyindex selected linked pointers of a specified size. This is used for the index and size values for NamedObject's which are listed on a hash map.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 1739 of file linked.h.
template<class T , unsigned M = 177>
Add a typed object derived from NamedObject to the hash map by name.
- Parameters
-
| name | to add. |
| object | to add. |
Definition at line 1786 of file linked.h.
template<class T , unsigned M = 177>
Add a typed object derived from NamedObject to the hash map by name.
- Parameters
-
| name | to add. |
| object | to add. |
Definition at line 1794 of file linked.h.
template<class T , unsigned M = 177>
Find first typed object in hash map to iterate.
- Returns
- first typed object or NULL if nothing in list.
Definition at line 1809 of file linked.h.
template<class T , unsigned M = 177>
Count the number of typed objects in our hash map.
- Returns
- count of typed objects.
Definition at line 1824 of file linked.h.
template<class T , unsigned M = 177>
Find a typed object derived from NamedObject in the hash map by name.
- Parameters
-
- Returns
- typed object if found through map or NULL.
Definition at line 1770 of file linked.h.
template<class T , unsigned M = 177>
Convert our hash map into a linear object pointer array.
The object pointer array is created from the heap and must be deleted when no longer used.
- Returns
- array of typed named object pointers.
Definition at line 1833 of file linked.h.
template<class T , unsigned M = 177>
Retrieve key size to use in NamedObject constructors.
- Returns
- key size of hash map.
Definition at line 1762 of file linked.h.
template<class T , unsigned M = 177>
Find next typed object in hash map for iteration.
- Parameters
-
| current | typed object we are referencing. |
- Returns
- next iterative object or NULL if past end of map.
Definition at line 1817 of file linked.h.
template<class T , unsigned M = 177>
Find a typed object derived from NamedObject in the hash map by name.
- Parameters
-
- Returns
- typed object if found through map or NULL.
Definition at line 1778 of file linked.h.
template<class T , unsigned M = 177>
Remove a typed object derived from NamedObject to the hash map by name.
- Parameters
-
- Returns
- object removed if found or NULL.
Definition at line 1802 of file linked.h.
template<class T , unsigned M = 177>
Retrieve root of index to use in NamedObject constructors.
- Returns
- root node of index.
Definition at line 1755 of file linked.h.
template<class T , unsigned M = 177>
Convert our hash map into an alphabetically sorted linear object pointer array.
The object pointer array is created from the heap and must be deleted when no longer used.
- Returns
- sorted array of typed named object pointers.
Definition at line 1842 of file linked.h.
The documentation for this class was generated from the following file: