Index

Package: Processes

Description

package Processes is

Types

Tick_Time

type Tick_Time is
        record
            total   : Time_Span;
            elapsed : Time_Span;
        end record;
'totalTime' is the amount of time elapsed since the process manager began running. 'elapsedTime' is the time elapsed since the previous tick or frame of execution.

Process (abstract)

type Process is limited interface;
A Process is attached to a Process_Manager to execute code periodically in time slices (also called a frame). Implementing the Process interface with any class and attaching an instance of it a process manager allows for any object to have its own behavior.

A_Process

type A_Process is access all Process'Class;

Subprograms & Entries

Get_Process_Name (abstract)

function Get_Process_Name
( this: access Process ) return String is abstract;
Returns a name identifying the process.

Tick (abstract)

procedure Tick
( this: access Process;
time: Tick_Time ) is abstract;
Executes one frame (time slice) of the process logic. 'time' contains information including how much time has elapsed since the last call to Tick and how long the process has been attached to the process manager. Processes are intended to execute their behavior iteratively; to update their state based on the passage of time and perform longer actions in small increments. Tick should finish its work and return as quickly as possible, to allow all the other processes attached to the manager enough time to execute before the next scheduled tick.