The Conroy & Conroy Subroutine Library (2021.3 edition)

TStandard_Cache_Manager
What: class
Ancestor: TSCache_Manager
File: CacheMan
Layer: 1
Platforms: C++, C#, Javascript, Pascal (OOP), PHP, Python

This defines a pointer to an instance of TStandard_Cache_Manager. It contains the following methods:

Add_Handler
void Add( PSCache Routine, int32 Priority )
procedure Add_Handler( Handler : TCache_Handler ; Delegation : TCache_Event ; Responder : PCache_Responder ; Cache : PSCache ; Priority : longint )
This routine adds a handler/responder to the handler list. Priority is the relative priority of the cache associated with the handler. Various handlers are supported, but only one is used if more than one is provided. When cache items need to be disposed of, the one called - if more than one are defined - is chosen in this order:
Cache = Actual cache instance. Trim is called to release data.
Responder = An instance of TCache_Responder.
Delegation = A delegation to a method of an object instance.
Handler = A callback function.

Delete
void Delete( PSCache Routine )
procedure Delete( Routine : PSCache )
This routine removes a cache from the cache handler list.

Free_Cache
void Free_Cache( int32 Siz, int32 Priority, PSCache Exclude )
procedure Free_Cache( Siz, Priority : longint ; Exclude : PSCache )
This routine calls the appropriate handler(s)) to free up Siz bytes of memory. A specific handler can be excluded from this. Calling this with Exclude of nil, priority of maxint, and Siz of -1, will zero all caches. Only handlers with a priority less than the passed priority are called.

Initialize
void Initialize())
procedure Initialize
Initializes the instance.

Terminate
void Terminate()
procedure Terminate
Terminates the instance.