The Conroy & Conroy Subroutine Library (2021.3 edition)

TDeferred_Manager
What: class
File: _Deferred
Ancestor: None
Layer: 1
Platforms: C++, C#, Javascript, Pascal (Object), PHP, Python

Defines a base abstract class for deferred execution. An instance of this class registerd with TDeferred_Manager will be called when deferred execution is triggered. The class contains the following method:

Add
void Add( TDeferred_Execution Item, void* Context )
procedure Add( Item : TDeferred_Execution ; Context : pointer )
Adds an item to the deferred execution queue. When executed, the Execute method of that item will be called and passed the specified context.

Execute_Next
void Execute_Next()
procedure Execute_Next
Execute the next registered item.

Index_Of
int Index_Of( TDeferred_Execution Item, void* Context )
function Index_Of( Item : TDeferred_Execution ; Context : pointer ) : integer
Returns the index of the matching item with the matching context.

Index_Of_First
int Index_Of_First( TDeferred_Execution Item )
function Index_Of_First( Item : TDeferred_Execution ) : integer
Returns the index of the first item matching the passed item.

Is_Empty
bool Is_Empty()
function Is_Empty()
Returns true if there is no more deferred code to execute.

Remove
void Remove( TDeferred_Execution Item, void* Context )
procedure Remove( Item : TDeferred_Execution ; Context : pointer )
Removes the matching item with the matching context.

Remove_All
void Remove_All( TDeferred_Execution Item )
procedure Remove_All( Item : TDeferred_Execution )
Removes all items from the queue.