#include <memory.h>
Public Member Functions | |
keyassoc (unsigned indexing=177, size_t max=0, size_t page=0) | |
Create a key associated memory pointer table. | |
~keyassoc () | |
Destroy association object. | |
unsigned | getCount (void) |
Get the number of associations we have in our object. | |
void * | operator() (const char *name) |
Lookup the data pointer of a string by direct operation. | |
void | purge (void) |
Purge all associations and return allocated pages to heap. | |
void * | locate (const char *name) |
Lookup the data pointer by the string name given. | |
bool | assign (char *name, void *pointer) |
Assign a name to a data pointer. | |
bool | create (char *name, void *pointer) |
Create a new name in the association table and assign it's value. | |
void * | remove (const char *name) |
Remove a name and pointer association. | |
Friends | |
class | keydata |
This is used to form a typeless data pointer that can be associated and referenced by string/logical name. The memory used for forming the string names can itself be managed in reusable memory pools and the entire structure uses it's own private pager heap. This allows new string named pointers to be added and deleted at runtime in a thread- safe manner. This might typically be used as a session id manager or for symbol tables.
Definition at line 381 of file memory.h.
ucc::keyassoc::keyassoc | ( | unsigned | indexing = 177 , |
|
size_t | max = 0 , |
|||
size_t | page = 0 | |||
) |
ucc::keyassoc::~keyassoc | ( | ) |
Destroy association object.
Release all pages back to the heap.
bool ucc::keyassoc::assign | ( | char * | name, | |
void * | pointer | |||
) |
bool ucc::keyassoc::create | ( | char * | name, | |
void * | pointer | |||
) |
Create a new name in the association table and assign it's value.
name | to create. | |
pointer | value to assign with name. |
unsigned ucc::keyassoc::getCount | ( | void | ) | [inline] |
Get the number of associations we have in our object.
Reimplemented in ucc::assoc_pointer< T, I, M, P >.
void* ucc::keyassoc::locate | ( | const char * | name | ) |
Lookup the data pointer by the string name given.
name | to lookup. |
Reimplemented in ucc::assoc_pointer< T, I, M, P >.
void* ucc::keyassoc::operator() | ( | const char * | name | ) | [inline] |
void* ucc::keyassoc::remove | ( | const char * | name | ) |