lace.event: Rid 'null_Event'.
This commit is contained in:
@@ -49,7 +49,7 @@ is
|
|||||||
-- Operations
|
-- 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;
|
from_Subject : in event.subject_Name) is abstract;
|
||||||
--
|
--
|
||||||
-- Accepts an Event from a Subject.
|
-- Accepts an Event from a Subject.
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ is
|
|||||||
-- Emit
|
-- 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.
|
-- 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;
|
return Observer_views is abstract;
|
||||||
--
|
--
|
||||||
-- Observers who cannot be communicated with are returned.
|
-- Observers who cannot be communicated with are returned.
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ package lace.Event
|
|||||||
is
|
is
|
||||||
pragma Pure;
|
pragma Pure;
|
||||||
|
|
||||||
type Item is tagged null record;
|
type Item is tagged private;
|
||||||
|
|
||||||
null_Event : constant Event.item;
|
|
||||||
|
|
||||||
|
|
||||||
subtype subject_Name is String;
|
subtype subject_Name is String;
|
||||||
@@ -35,5 +33,13 @@ is
|
|||||||
|
|
||||||
|
|
||||||
private
|
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;
|
end lace.Event;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
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)
|
from_Subject : in Event.subject_Name)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
@@ -184,7 +184,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
procedure receive (Self : access Item'Class;
|
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)
|
from_Subject : in Event.subject_Name)
|
||||||
is
|
is
|
||||||
use event_response_Maps,
|
use event_response_Maps,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
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);
|
from_Subject : in Event.subject_Name);
|
||||||
overriding
|
overriding
|
||||||
procedure respond (Self : access Item);
|
procedure respond (Self : access Item);
|
||||||
@@ -120,7 +120,7 @@ private
|
|||||||
--
|
--
|
||||||
|
|
||||||
procedure receive (Self : access Item'Class;
|
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);
|
from_Subject : in Event.subject_Name);
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
overriding
|
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
|
is
|
||||||
begin
|
begin
|
||||||
if Self.Emitter = null
|
if Self.Emitter = null
|
||||||
@@ -145,7 +145,7 @@ is
|
|||||||
|
|
||||||
|
|
||||||
overriding
|
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
|
return subject.Observer_views
|
||||||
is
|
is
|
||||||
use lace.Event.utility;
|
use lace.Event.utility;
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
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
|
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;
|
return subject.Observer_views;
|
||||||
|
|
||||||
overriding
|
overriding
|
||||||
@@ -109,8 +109,8 @@ private
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------------
|
------------------
|
||||||
-- Safe observers
|
-- Safe observers.
|
||||||
--
|
--
|
||||||
protected
|
protected
|
||||||
type safe_Observers
|
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_Emitter_view is access all event_Emitter.item'Class;
|
||||||
type event_Sender_view is access all event_Sender .item'Class;
|
type event_Sender_view is access all event_Sender .item'Class;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
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)
|
from_Subject : in Event.subject_Name)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ is
|
|||||||
--
|
--
|
||||||
|
|
||||||
overriding
|
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);
|
from_Subject : in Event.subject_Name);
|
||||||
overriding
|
overriding
|
||||||
procedure respond (Self : access Item);
|
procedure respond (Self : access Item);
|
||||||
|
|||||||
Reference in New Issue
Block a user