Index

Package: Managers

Description

package Processes.Managers is

Classes

Process_Manager

type Process_Manager is new Limited_Object with private;

Ancestors:

Primitive operations:

Construct
Delete (overriding Objects.Delete)
Objects.Construct (Inherited)
Objects.To_String (Inherited)

Types

A_Process_Manager

type A_Process_Manager is access all Process_Manager'Class;

A_Destructor

type A_Destructor is access procedure( process : in out A_Process );
Reference to a procedure that is responsible for destroying a process.

Subprograms & Entries

Create_Process_Manager

function Create_Process_Manager
( name: String;
hertz: Natural := 0;
minHertz: Natural := 0 ) return A_Process_Manager;
An update rate of 0 hertz means maximum update rate, without delay between frames. 'minHertz' is not the minimum actual rate of the process manager because it is unable to interrupt or skip processes; it is the minimum time delta reported to the processes on tick. If some processes can't handle large time deltas but sometimes they do happen, 'minHertz' will prevent the processes from getting a dt that's too big.

Attach

procedure Attach
( this: not null access Process_Manager'Class;
proc: not null A_Process );
Attach a process to the process manager for execution. It will be executed last in the rotation of attached processes. This can be done before or after starting the process manager.

Detach

procedure Detach
( this: not null access Process_Manager'Class;
proc: not null A_Process;
destructor: A_Destructor := null );
Detaches a process from the process manager. This can be done at any time.

Get_Name

function Get_Name
( this: not null access Process_Manager'Class ) return String;
Returns the name of the process manager as given at creation.

Get_Rate

function Get_Rate
( this: not null access Process_Manager'Class ) return Natural;
Returns the rate in Hz that the process manager is ticking its processes.

Pause

procedure Pause
( this: not null access Process_Manager'Class;
proc: not null A_Process;
paused: Boolean );
Pauses/resumes the given process if it's attached to this manager. If paused, Tick will not be called until after the process has been resumed.

Start

procedure Start
( this: not null access Process_Manager'Class );
Starts execution of the processes.

Stop

procedure Stop
( this: not null access Process_Manager'Class );
Stops execution of the processes.

Track_Rate

procedure Track_Rate
( this: not null access Process_Manager'Class;
enabled: Boolean );
Instructs the process manager to track the rate at which it is executing its processes. This is useful for determining frame rates or finding which process manager threads are running too slowly.

Delete

procedure Delete
( this: in out A_Process_Manager );
Deletes a process manager. Its attached processes, if it has any at the time of deletion, are detached and left unchanged.