UCommon
|
A template class for a hash pager. More...
#include <memory.h>
Public Types | |
typedef linked_pointer< T > | iterator |
Convenience typedef for iterative pointer. | |
Public Member Functions | |
T * | begin (void) const |
Find first typed object in hash map to iterate. | |
unsigned | count (void) const |
Count the number of typed objects in our hash map. | |
T * | get (const char *name) const |
Find a typed object derived from NamedObject in the hash map by name. | |
T ** | index (void) const |
Convert our hash map into a linear object pointer array. | |
keypager (size_t size) | |
Create the object cache. | |
T * | next (T *current) const |
Find next typed object in hash map for iteration. | |
T * | operator[] (const char *name) const |
Find a typed object derived from NamedObject in the hash map by name. | |
T ** | sort (void) const |
Convert our hash map into an alphabetically sorted linear object pointer array. | |
bool | test (const char *name) const |
Test if a name exists in the pool. | |
~keypager () | |
Destroy the hash pager by purging the index chains and memory pools. |
A template class for a hash pager.
This creates objects from a pager pool when they do not already exist in the hash map.
ucommon::keypager< T, M >::keypager | ( | size_t | size | ) | [inline] |
T* ucommon::keypager< T, M >::begin | ( | void | ) | const [inline] |
unsigned ucommon::keypager< T, M >::count | ( | void | ) | const [inline] |
T* ucommon::keypager< T, M >::get | ( | const char * | name | ) | const [inline] |
Find a typed object derived from NamedObject in the hash map by name.
If the object is not found, it is created from the memory pool.
name | to search for. |
Definition at line 1314 of file memory.h.
T** ucommon::keypager< T, M >::index | ( | void | ) | const [inline] |
T* ucommon::keypager< T, M >::next | ( | T * | current | ) | const [inline] |
T* ucommon::keypager< T, M >::operator[] | ( | const char * | name | ) | const [inline] |
Find a typed object derived from NamedObject in the hash map by name.
If the object is not found, it is created from the pager pool.
name | to search for. |
T** ucommon::keypager< T, M >::sort | ( | void | ) | const [inline] |
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.
Definition at line 1377 of file memory.h.
bool ucommon::keypager< T, M >::test | ( | const char * | name | ) | const [inline] |