TCache class
Cache class.
Declaration
TCache = classDescription
TCache implements a cache class: it is a list-like class,
but which uses a counting mechanism, and keeps a Most-Recent-Used list;
this list represents the 'cache'. The list is internally kept as a
doubly-linked list.
The Data property offers indexed access to the array of items. When accessing the array through this property, the MRUSlot property is updated.
Properties
Data | public | Indexed access to data items. |
MRUSlot | public | Most recent item slot. |
LRUSlot | public | Last used item. |
SlotCount | public | Number of slots in the list. |
Slots | public | Indexed array to the slots. |
Methods
Create | public | Create a new cache class. |
Destroy | public | Free the TCache class from memory. |
Add | public | Add a data element to the list. |
AddNew | public | Add a new item to the list. |
FindSlot | public | Find data pointer in the list. |
IndexOf | public | Return index of a data pointer in the list. |
Remove | public | Remove a data item from the list. |
Events
OnIsDataEqual | public | Event to compare 2 items. |
OnFreeSlot | public | Event called when a slot is freed. |
Fields
FSlotCount | protected | |
FSlots | protected | |
FMRUSlot | protected | |
FLRUSlot | protected |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
