A typed template for using a key association with typed objects. More...
#include <memory.h>
Public Member Functions | |
bool | assign (char *name, T *pointer) |
Assign a name for a pointer to a typed object. | |
assoc_pointer () | |
Construct an associated pointer hash map based on the class template. | |
unsigned | count (void) const |
Get the count of typed objects stored in our hash map. | |
bool | create (char *name, T *pointer) |
Create a new name in the association table and assign typed object. | |
T * | locate (const char *name) |
Lookup a typed object by name. | |
T * | operator() (const char *name) |
Reference a typed object directly by name. | |
T * | operator[] (const char *name) |
unsigned | pages (void) const |
Access to number of pages allocated from heap for our associated index pointer. | |
void | purge (void) |
Purge the hash map of typed objects. | |
void | remove (char *name) |
Remove a name and typed pointer association. | |
unsigned | utilization (void) const |
Access to pager utilization stats. |
A typed template for using a key association with typed objects.
This essentially forms a form of "smart pointer" that is a reference to specific typed objects by symbolic name. This is commonly used as for associated indexing of typed objects.
Definition at line 1166 of file memory.h.
bool ucommon::assoc_pointer< T, I, M, P >::assign | ( | char * | name, | |
T * | pointer | |||
) | [inline] |
unsigned ucommon::assoc_pointer< T, I, M, P >::count | ( | void | ) | const [inline] |
Get the count of typed objects stored in our hash map.
Reimplemented from ucommon::keyassoc.
bool ucommon::assoc_pointer< T, I, M, P >::create | ( | char * | name, | |
T * | pointer | |||
) | [inline] |
T* ucommon::assoc_pointer< T, I, M, P >::locate | ( | const char * | name | ) | [inline] |
Lookup a typed object by name.
name | of typed object to locate. |
Reimplemented from ucommon::keyassoc.
T* ucommon::assoc_pointer< T, I, M, P >::operator() | ( | const char * | name | ) | [inline] |
Reference a typed object directly by name.
name | of typed object to locate. |
Reimplemented from ucommon::keyassoc.
unsigned ucommon::assoc_pointer< T, I, M, P >::pages | ( | void | ) | const [inline] |
Access to number of pages allocated from heap for our associated index pointer.
This is needed because we inherit keyassoc privately.
Reimplemented from ucommon::memalloc.
void ucommon::assoc_pointer< T, I, M, P >::remove | ( | char * | name | ) | [inline] |
unsigned ucommon::assoc_pointer< T, I, M, P >::utilization | ( | void | ) | const [inline] |