THashCacheTimer

From Ultibo.org
Jump to: navigation, search

Return to Unit Filesystem


Description


To be documented

Class definitions



THashCacheTimer = class(TObject)

constructor Create(ACache:THashCache);  
destructor Destroy; override;  
protected
FCache:THashCache;  
 
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 THashCacheTimer.Create(ACache:THashCache);
Description: To be documented
Note None documented


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


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


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


function THashCacheTimer.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 THashCacheTimer.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 THashCacheTimer.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 THashCacheTimer.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 THashCacheTimer.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 THashCacheTimer.StartTimer(AInterval:LongWord):Boolean;
Description: To be documented
Note None documented


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


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


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


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


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


Return to Unit Reference