Index

Package: Corrals

Description

package Events.Corrals is

Classes

Corral

type Corral is new Limited_Object and Process with private;

Ancestors:

Primitive operations:

Add_Listener
Construct
Delete (overriding Objects.Delete)
Get_Process_Name
Objects.Construct (Inherited)
Processes.Get_Process_Name (Inherited)
Processes.Tick (Inherited)
Remove_Listener
Tick
To_String (overriding Objects.To_String)
Trigger_Event

Types

A_Corral

type A_Corral is access all Corral'Class;

Subprograms & Entries

Create_Corral

function Create_Corral
( name: String ) return A_Corral;
Creates a new corral to receive events from the global event manager.

Add_Listener

procedure Add_Listener
( this: access Corral;
listener: not null A_Event_Listener;
evtName: String );
Registers an object as a listener for a specific type of event. Listeners will receive all events sent to this corral unless the event has been consumed by an earlier registered handler that wants to prevent an event from propagating. Event listeners are notified in the order in which they register with the corral.

Get_Name

function Get_Name
( this: access Corral ) return String;
Returns the name of the corral.

Queue_Event

procedure Queue_Event
( this: access Corral;
evt: in out A_Event );
Queue an event to be dispatched to all the registered listener objects. The event will be consumed.

Remove_Listener

procedure Remove_Listener
( this: access Corral;
listener: not null A_Event_Listener;
evtName: String );
Unregisters an object as a listener for a specific type of event. If the listener was not previously registered, this has no effect.

Trigger_Event

procedure Trigger_Event
( this: access Corral;
evt: in out A_Event;
response: out Response_Type );
Dispatches an event immediately, separate from the queue. The event will be consumed.

Delete

procedure Delete
( this: in out A_Corral );
Deletes the corral.