TCacheTimer

From Ultibo.org
Jump to: navigation, search

Return to Unit Filesystem


Description


To be documented

Class definitions



TCacheTimer = class(TObject)

constructor Create(ACache:TCache);  
destructor Destroy; override;  
protected
FCache:TCache;  
 
FLock:TMutexHandle;  
FInterval:LongWord;  
FCheckTimer:TTimerHandle;  
FProcessSemaphore:TSemaphoreHandle;  
 
FFirst:PCacheTimerItem;  
FLast:PCacheTimerItem;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function Dequeue(AMax:Integer):TCachePage;  
 
function FirstKey:Integer;  
function InsertKey(APage:TCachePage; AKey:Integer):Boolean;  
function DeleteKey(APage:TCachePage):Boolean;  
function DecrementKey:Integer;  
public
function StartTimer(AInterval:LongWord):Boolean;  
function StopTimer:Boolean;  
 
function CheckTimer:Boolean;  
function ProcessTimer:Boolean;  
 
function SchedulePage(APage:TCachePage; ATimeout:LongWord):Boolean;  
function UnschedulePage(APage:TCachePage):Boolean;  


Function declarations



constructor TCacheTimer.Create(ACache:TCache);
Description: To be documented
Note None documented


destructor TCacheTimer.Destroy;
Description: To be documented
Note None documented


function TCacheTimer.AcquireLock:Boolean;
Description: To be documented
Note None documented


function TCacheTimer.ReleaseLock:Boolean;
Description: To be documented
Note None documented


function TCacheTimer.Dequeue(AMax:Integer):TCachePage;
Description: Get and remove the first page from the timer list if the key is less than or equal to Max
Max The maximum value of the key for the page to be dequeued
Return Dequeued Page or nil on non ready or failure


function TCacheTimer.FirstKey:Integer;
Description: Get the first Key value from the timer list
Return First Key value from timer list or CACHE_TIMER_KEY_NONE on failure


function TCacheTimer.InsertKey(APage:TCachePage; AKey:Integer):Boolean;
Description: Insert the supplied page in the timer list in delta ascending order based on Key
Page The page to be inserted
Key The key to order the insertion on
Return True if completed or False on failure


function TCacheTimer.DeleteKey(APage:TCachePage):Boolean;
Description: Delete the supplied page from the timer list
Page The page to be deleted
Return True if completed or False on failure


function TCacheTimer.DecrementKey:Integer;
Description: Decrement the first Key value in the Timer list
Return First Key value in timer list after decrement or CACHE_TIMER_KEY_NONE on failure


function TCacheTimer.StartTimer(AInterval:LongWord):Boolean;
Description: To be documented
Note None documented


function TCacheTimer.StopTimer:Boolean;
Description: To be documented
Note None documented


function TCacheTimer.CheckTimer:Boolean;
Description: To be documented
Note None documented


function TCacheTimer.ProcessTimer:Boolean;
Description: To be documented
Note None documented


function TCacheTimer.SchedulePage(APage:TCachePage; ATimeout:LongWord):Boolean;
Description: To be documented
Note None documented


function TCacheTimer.UnschedulePage(APage:TCachePage):Boolean;
Description: To be documented
Note None documented


Return to Unit Reference