Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cUIDManagerArray Class Reference

#include <cUIDManagerArray.h>

Inheritance diagram for GrayLib::cUIDManagerArray:
Gray::cThreadLockStub Gray::cLockableBase

Public Member Functions

 cUIDManagerArray (const cUIDRangeMask &mask, bool bReUseFreedUIDs=true)
 
 ~cUIDManagerArray ()
 
UIDINDEX_t get_UIDCount () const noexcept
 
virtual cXObjectPtr FindUIDObj (UID_t nUID) const
 
bool isIndexPlaceHolder (UIDINDEX_t dwIndex) const
 
void ClearUIDPlaceHolder (UID_t nUID)
 
bool FreeUID (UID_t nUID)
 
bool FreeUID (cXObject *pObj)
 
UID_t LoadUID (cXObject *pObj, UID_t dwIndex)
 
UID_t AllocUID (cXObject *pObj)
 
void FlushFreeUIDs ()
 
void DisposeAllUIDs ()
 
void put_ReUseFreeUIDs (bool bReUseFreeUIDs)
 
 UNITTEST_FRIEND (cUIDManagerArray)
 
- Public Member Functions inherited from Gray::cThreadLockStub
THREADID_t get_ThreadLockOwner () const
 

Public Attributes

cUIDRangeMask m_UIDRange
 Mask of the range of valid UID's (allow high bits to float) More...
 

Protected Member Functions

UIDINDEX_t FindFreeIndex ()
 
- Protected Member Functions inherited from Gray::cLockableBase
 cLockableBase () noexcept
 
 ~cLockableBase ()
 
LONG get_LockCount () const
 
bool isLocked () const
 
void IncLockCount ()
 
LONG DecLockCount ()
 
void Lock ()
 
LONG Unlock ()
 

Detailed Description

Manage a range/pool of UID's in memory. a fast way to find a free UID. We might have used a CHash but this is faster. The array container to track all the used/unused UIDs 0 UID is reserved. as are values >= cUIDRangeMask

Constructor & Destructor Documentation

◆ cUIDManagerArray()

GrayLib::cUIDManagerArray::cUIDManagerArray ( const cUIDRangeMask mask,
bool  bReUseFreedUIDs = true 
)

◆ ~cUIDManagerArray()

GrayLib::cUIDManagerArray::~cUIDManagerArray ( )

Member Function Documentation

◆ AllocUID()

UID_t GrayLib::cUIDManagerArray::AllocUID ( cXObject pObj)

◆ ClearUIDPlaceHolder()

void GrayLib::cUIDManagerArray::ClearUIDPlaceHolder ( UID_t  nUID)

◆ DisposeAllUIDs()

void GrayLib::cUIDManagerArray::DisposeAllUIDs ( )

◆ FindFreeIndex()

UIDINDEX_t GrayLib::cUIDManagerArray::FindFreeIndex ( )
protected

◆ FindUIDObj()

virtual cXObjectPtr GrayLib::cUIDManagerArray::FindUIDObj ( UID_t  nUID) const
inlinevirtual

◆ FlushFreeUIDs()

void GrayLib::cUIDManagerArray::FlushFreeUIDs ( )

clear out all the UIDs marked for delete.

◆ FreeUID() [1/2]

bool GrayLib::cUIDManagerArray::FreeUID ( cXObject pObj)

◆ FreeUID() [2/2]

bool GrayLib::cUIDManagerArray::FreeUID ( UID_t  nUID)

Can't free up the UID until after the save !

◆ get_UIDCount()

UIDINDEX_t GrayLib::cUIDManagerArray::get_UIDCount ( ) const
inlinenoexcept

◆ isIndexPlaceHolder()

bool GrayLib::cUIDManagerArray::isIndexPlaceHolder ( UIDINDEX_t  dwIndex) const
inline

◆ LoadUID()

UID_t GrayLib::cUIDManagerArray::LoadUID ( cXObject pObj,
UID_t  dwIndex 
)

Loading an object that wants a specific UID. nUID = Set to this UID

Returns
0 = failed.

◆ put_ReUseFreeUIDs()

void GrayLib::cUIDManagerArray::put_ReUseFreeUIDs ( bool  bReUseFreeUIDs)

Do not release UID's to be re-used.

◆ UNITTEST_FRIEND()

GrayLib::cUIDManagerArray::UNITTEST_FRIEND ( cUIDManagerArray  )

Member Data Documentation

◆ m_UIDRange

cUIDRangeMask GrayLib::cUIDManagerArray::m_UIDRange

Mask of the range of valid UID's (allow high bits to float)


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