Hash map from pointer keys to borrowed pointer values, with pooled associations.
More...
#include <mfc.h>
|
| | CMapPtrToPtr (int blockSize=10) |
| | Initialise an empty map with 17 buckets allocated on first insertion.
|
| | ~CMapPtrToPtr () override |
| | Release buckets and association pools without deleting key or value objects.
|
| int | GetCount () const |
| UINT | GetHashTableSize () const |
| void | SetAt (void *key, void *value) |
| | Insert or replace a pointer without releasing the previous value.
|
| BOOL | RemoveKey (void *key) |
| | Remove an association and release all storage when the map becomes empty.
|
| void | InitHashTable (UINT hashSize, BOOL allocate=TRUE) |
| | Replace bucket storage in an empty map without changing the association-pool configuration.
|
| virtual CRuntimeClass * | GetRuntimeClass () const |
| virtual | ~CObject () |
| | The base destructor does not perform additional cleanup.
|
| virtual void | Serialize (CArchive &archive) |
| | Do not serialise archive data.
|
| virtual void | AssertValid () const |
| | Do not validate object state.
|
| virtual void | Dump (CDumpContext &context) const |
| | Do not emit diagnostic output.
|
Hash map from pointer keys to borrowed pointer values, with pooled associations.
Keys are compared as pointer values without dereferencing; neither keys nor values are deleted. Hash-table reinitialisation requires an empty map.
◆ CMapPtrToPtr()
| CMapPtrToPtr::CMapPtrToPtr |
( |
int | blockSize = 10 | ) |
|
|
explicit |
Initialise an empty map with 17 buckets allocated on first insertion.
- Parameters
-
| blockSize | The positive number of associations allocated per pool block. |
◆ ~CMapPtrToPtr()
| CMapPtrToPtr::~CMapPtrToPtr |
( |
| ) |
|
|
override |
Release buckets and association pools without deleting key or value objects.
◆ GetCount()
| int CMapPtrToPtr::GetCount |
( |
| ) |
const |
- Returns
- The number of registered associations.
◆ GetHashTableSize()
| UINT CMapPtrToPtr::GetHashTableSize |
( |
| ) |
const |
- Returns
- The configured bucket count, even before bucket allocation.
◆ SetAt()
| void CMapPtrToPtr::SetAt |
( |
void * | key, |
|
|
void * | value ) |
Insert or replace a pointer without releasing the previous value.
- Parameters
-
| key | The pointer-valued key, possibly null. |
| value | The borrowed pointer value, possibly null. |
◆ RemoveKey()
| BOOL CMapPtrToPtr::RemoveKey |
( |
void * | key | ) |
|
Remove an association and release all storage when the map becomes empty.
- Parameters
-
| key | The pointer-valued key supplied at insertion. |
- Returns
- TRUE when an association was removed; otherwise FALSE.
◆ InitHashTable()
| void CMapPtrToPtr::InitHashTable |
( |
UINT | hashSize, |
|
|
BOOL | allocate = TRUE ) |
Replace bucket storage in an empty map without changing the association-pool configuration.
- Parameters
-
| hashSize | The positive bucket count. |
| allocate | Whether to allocate buckets immediately rather than on first insertion. |
The documentation for this class was generated from the following file: