1#ifndef COASTLINE_EAR_REGISTRY_H
2#define COASTLINE_EAR_REGISTRY_H
21template <
typename Value>
38 value =
static_cast<Value *
>(entry);
66 copy.SetWordPointerMapValue(key,
static_cast<Value *
>(entry));
70 position = copy.GetStartPosition();
74 copy.GetNextAssoc(position, key, entry);
86template <
typename Value>
98#if TGR_PLATFORM == TGR_PLATFORM_WIN
113#if TGR_PLATFORM == TGR_PLATFORM_WIN
165 Association **hashTable;
168 Association *freeAssociations;
BOOL RemoveKey(void *key)
Remove an association and release all storage when the map becomes empty.
void SetAt(void *key, void *value)
Insert or replace a pointer without releasing the previous value.
CMapPtrToPtr(int blockSize=10)
Initialise an empty map with 17 buckets allocated on first insertion.
CMapWordToPtr(int blockSize=10)
Initialise an empty map with 17 buckets allocated on first insertion.
void GetNextAssoc(POSITION &position, WORD &key, void *&value) const
Retrieve an association in hash-bucket order and advance the cursor.
POSITION GetStartPosition() const
void RemoveAll()
Release all associations and buckets without deleting pointer values.
void SetAt(WORD key, void *value)
Insert or replace a pointer without releasing the previous value.
UINT GetHashTableSize() const
void InitHashTable(UINT hashSize, BOOL allocate=TRUE)
Replace bucket storage in an empty map without changing the association-pool configuration.
BOOL Lookup(WORD key, void *&value) const
Look up a pointer without changing the output on a missing key.
Polymorphic MFC compatibility base with inactive serialisation and diagnostic hooks.
Definition mfc.h:26
Map 32-bit event identifiers to 16-bit channel handles using pooled associations.
Definition registry.h:122
~EarActiveEventRegistry() override
Release hash buckets and association pools without changing external events.
void SetAt(DWORD key, WORD value)
Insert or replace a channel handle.
BOOL IsEmpty() const
Definition registry.h:137
BOOL RemoveKey(DWORD key)
Remove an association without stopping the event.
EarActiveEventRegistry(int blockSize=10)
Initialise an empty registry with 17 hash buckets allocated on first insertion.
BOOL Lookup(DWORD key, WORD &value) const
Look up a channel handle without changing the output on a missing key.
Map 32-bit handles through pointer keys without deleting registered objects.
Definition registry.h:88
void SetDwordPointerMapValue(DWORD key, Value *value)
Insert or replace a borrowed object pointer using the handle bits as the map key.
Definition registry.h:97
BOOL RemovePlaybackRegistryKey(DWORD key)
Remove a mapping without releasing the registered object.
Definition registry.h:112
Default-registration marker, set after a registration attempt even when registration fails.
Definition environment.h:94
Common event playback state with overridable media, device, and stream operations.
Definition earplayback.h:17
A wave file loaded whole into memory, which a preset registers and sample playbacks share.
Definition wavesample.h:15
Map 16-bit handles to borrowed object pointers without deleting registered objects.
Definition registry.h:23
void GrowWhenFull()
Rebuild with ten additional buckets when entry count equals bucket count.
Definition registry.h:55
void SetWordPointerMapValue(std::uint16_t key, Value *value)
Insert or replace a pointer without releasing the previous object.
Definition registry.h:48
BOOL LookupWordPointerMapValue(std::uint16_t key, Value *&value) const
Look up a registered pointer without changing the output on a missing key.
Definition registry.h:33
struct __POSITION * POSITION
Opaque container position representation; instances must not be dereferenced.
#define TRUE
Definition ultratypes.h:53
#define FALSE
Definition ultratypes.h:54