#include <cachfifo.h>
Inheritance diagram for ObjectCacheFIFO:
Public Member Functions | |
ObjectCacheFIFO () | |
default constructor for ObjectCacheFIFO. First contains the handle of the first object in the hash table. Note: | |
ObjectCacheFIFO (UINT32 ceiling) | |
constructor for ObjectCacheFIFO Note: | |
~ObjectCacheFIFO () | |
destructor for ObjectCache Note: | |
Protected Member Functions | |
virtual BOOL | DeleteObject () |
FIFO Cache replacement policy. Note:. | |
Protected Attributes | |
WORD | m_first |
Private Member Functions | |
CC_DECLARE_DYNCREATE (ObjectCacheFIFO) |
Definition at line 118 of file cachfifo.h.
|
default constructor for ObjectCacheFIFO. First contains the handle of the first object in the hash table. Note:
Definition at line 128 of file cachfifo.cpp.
|
|
constructor for ObjectCacheFIFO Note:
Definition at line 145 of file cachfifo.cpp.
|
|
destructor for ObjectCache Note:
Definition at line 161 of file cachfifo.cpp.
|
|
|
|
FIFO Cache replacement policy. Note:.
Reimplemented from ObjectCache. Definition at line 178 of file cachfifo.cpp. 00179 { 00180 CachedObject* pObj = NULL; 00181 00182 if (m_NumObjects == 0) 00183 return FALSE; 00184 00185 WORD hObj = m_first; // First element in the hash table, 00186 // corresponds to the first generated handle. 00187 pObj = LookUp(hObj); 00188 BOOL ok = (pObj != NULL); 00189 00190 if (ok) 00191 { 00192 Remove(hObj); // remove from the hash table 00193 m_NumObjects--; // decrease the number of objects 00194 m_CurrentSize -= pObj->GetSize(); // decrease the used space of cache 00195 00196 delete pObj; 00197 pObj = NULL; 00198 00199 if (m_NumObjects >= 1) 00200 m_first++; 00201 00202 return TRUE; 00203 } 00204 00205 return FALSE; 00206 }
|
|
Definition at line 130 of file cachfifo.h. |