coastline 0.0.4
Loading...
Searching...
No Matches
EarWordPointerRegistry< Value > Class Template Reference

Map 16-bit handles to borrowed object pointers without deleting registered objects. More...

#include <registry.h>

Inheritance diagram for EarWordPointerRegistry< Value >:
Collaboration diagram for EarWordPointerRegistry< Value >:

Public Member Functions

BOOL LookupWordPointerMapValue (std::uint16_t key, Value *&value) const
 Look up a registered pointer without changing the output on a missing key.
void SetWordPointerMapValue (std::uint16_t key, Value *value)
 Insert or replace a pointer without releasing the previous object.
void GrowWhenFull ()
 Rebuild with ten additional buckets when entry count equals bucket count.
Public Member Functions inherited from CMapWordToPtr
 CMapWordToPtr (int blockSize=10)
 Initialise an empty map with 17 buckets allocated on first insertion.
 ~CMapWordToPtr () override
 Release buckets and association pools without deleting pointer values.
int GetCount () const
UINT GetHashTableSize () const
BOOL IsEmpty () const
BOOL Lookup (WORD key, void *&value) const
 Look up a pointer without changing the output on a missing key.
void SetAt (WORD key, void *value)
 Insert or replace a pointer without releasing the previous value.
BOOL RemoveKey (WORD key)
 Remove an association and release all storage when the map becomes empty.
void RemoveAll ()
 Release all associations and buckets without deleting pointer values.
POSITION GetStartPosition () const
void GetNextAssoc (POSITION &position, WORD &key, void *&value) const
 Retrieve an association in hash-bucket order and advance the cursor.
void InitHashTable (UINT hashSize, BOOL allocate=TRUE)
 Replace bucket storage in an empty map without changing the association-pool configuration.
Public Member Functions inherited from CObject
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.

Detailed Description

template<typename Value>
requires std::is_class_v<Value>
class EarWordPointerRegistry< Value >

Map 16-bit handles to borrowed object pointers without deleting registered objects.

Template Parameters
ValueThe registered class type.

Member Function Documentation

◆ LookupWordPointerMapValue()

template<typename Value>
BOOL EarWordPointerRegistry< Value >::LookupWordPointerMapValue ( std::uint16_t key,
Value *& value ) const
inline

Look up a registered pointer without changing the output on a missing key.

Parameters
keyThe 16-bit object handle.
valueThe output borrowed pointer, valid while the object remains allocated.
Returns
TRUE when the key exists, including an entry with a null pointer; otherwise FALSE.
Ghidra address:
EAR: 0x1000c300

◆ SetWordPointerMapValue()

template<typename Value>
void EarWordPointerRegistry< Value >::SetWordPointerMapValue ( std::uint16_t key,
Value * value )
inline

Insert or replace a pointer without releasing the previous object.

Parameters
keyThe 16-bit object handle.
valueThe borrowed object pointer, possibly null.
Ghidra address:
EAR: 0x10006750

◆ GrowWhenFull()

template<typename Value>
void EarWordPointerRegistry< Value >::GrowWhenFull ( )
inline

Rebuild with ten additional buckets when entry count equals bucket count.

Registered object pointers remain unchanged; association positions become invalid.


The documentation for this class was generated from the following file: