lace.event: Rid 'null_Event'.

This commit is contained in:
Rod Kay
2024-10-07 16:36:32 +11:00
parent 4f080dc3bc
commit 37e3e74783
9 changed files with 27 additions and 22 deletions

View File

@@ -49,7 +49,7 @@ is
-- Operations
--
procedure receive (Self : access Item; the_Event : in Event.item'Class := event.null_Event;
procedure receive (Self : access Item; the_Event : in Event.item'Class;
from_Subject : in event.subject_Name) is abstract;
--
-- Accepts an Event from a Subject.

View File

@@ -61,11 +61,11 @@ is
-- Emit
--
procedure emit (Self : access Item; the_Event : in Event.item'Class := Event.null_Event) is abstract;
procedure emit (Self : access Item; the_Event : in Event.item'Class) is abstract;
--
-- Communication errors are ignored.
function emit (Self : access Item; the_Event : in Event.item'Class := Event.null_Event)
function emit (Self : access Item; the_Event : in Event.item'Class)
return Observer_views is abstract;
--
-- Observers who cannot be communicated with are returned.

View File

@@ -9,9 +9,7 @@ package lace.Event
is
pragma Pure;
type Item is tagged null record;
null_Event : constant Event.item;
type Item is tagged private;
subtype subject_Name is String;
@@ -35,5 +33,13 @@ is
private
null_Event : constant Event.item := (others => <>);
type sequence_Id is range 0 .. 2**32 - 1;
type Item is tagged
record
s_Id : sequence_Id;
end record;
end lace.Event;

View File

@@ -63,7 +63,7 @@ is
--
overriding
procedure receive (Self : access Item; the_Event : in Event.item'Class := Event.null_Event;
procedure receive (Self : access Item; the_Event : in Event.item'Class;
from_Subject : in Event.subject_Name)
is
begin
@@ -184,7 +184,7 @@ is
--
procedure receive (Self : access Item'Class;
the_Event : in Event.item'Class := Event.null_Event;
the_Event : in Event.item'Class;
from_Subject : in Event.subject_Name)
is
use event_response_Maps,

View File

@@ -48,7 +48,7 @@ is
--
overriding
procedure receive (Self : access Item; the_Event : in Event.item'Class := event.null_Event;
procedure receive (Self : access Item; the_Event : in Event.item'Class;
from_Subject : in Event.subject_Name);
overriding
procedure respond (Self : access Item);
@@ -120,7 +120,7 @@ private
--
procedure receive (Self : access Item'Class;
the_Event : in Event.item'Class := Event.null_Event;
the_Event : in Event.item'Class;
from_Subject : in Event.subject_Name);
private

View File

@@ -102,7 +102,7 @@ is
overriding
procedure emit (Self : access Item; the_Event : in Event.item'Class := Event.null_Event)
procedure emit (Self : access Item; the_Event : in Event.item'Class)
is
begin
if Self.Emitter = null
@@ -145,7 +145,7 @@ is
overriding
function emit (Self : access Item; the_Event : in Event.item'Class := Event.null_Event)
function emit (Self : access Item; the_Event : in Event.item'Class)
return subject.Observer_views
is
use lace.Event.utility;

View File

@@ -59,10 +59,10 @@ is
--
overriding
procedure emit (Self : access Item; the_Event : in Event.item'Class := Event.null_Event); -- TODO: Rid default.
procedure emit (Self : access Item; the_Event : in Event.item'Class);
overriding
function emit (Self : access Item; the_Event : in Event.item'Class := Event.null_Event) -- TODO: Rid default.
function emit (Self : access Item; the_Event : in Event.item'Class)
return subject.Observer_views;
overriding
@@ -109,8 +109,8 @@ private
-----------------
-- Safe observers
------------------
-- Safe observers.
--
protected
type safe_Observers
@@ -132,10 +132,9 @@ private
---------------
-- Subject Item
----------------
-- Subject Item.
--
type event_Emitter_view is access all event_Emitter.item'Class;
type event_Sender_view is access all event_Sender .item'Class;

View File

@@ -23,7 +23,7 @@ is
--
overriding
procedure receive (Self : access Item; the_Event : in Event.item'Class := Event.null_Event;
procedure receive (Self : access Item; the_Event : in Event.item'Class;
from_Subject : in Event.subject_Name)
is
begin

View File

@@ -31,7 +31,7 @@ is
--
overriding
procedure receive (Self : access Item; the_Event : in Event.item'Class := Event.null_Event;
procedure receive (Self : access Item; the_Event : in Event.item'Class;
from_Subject : in Event.subject_Name);
overriding
procedure respond (Self : access Item);