From: Mirko Aigner <Mirko.Aigner@alcatel.de>
Subject: Re: circular unit dependency
Date: Mon, 26 May 2003 10:05:28 +0200
Date: 2003-05-26T10:05:28+02:00 [thread overview]
Message-ID: <3ED1CAC8.1090808@alcatel.de> (raw)
In-Reply-To: ud6i95ydx.fsf@nasa.gov
Stephen Leake wrote:
>
> You will have to change something. You'll have to post the code, so we
> can help you figure out what to change. Try to simplify it first.
>
I'm Sorry, Ok here comes some code.
Some words to the structure at first. There is a boundary subsystem
where logical Messages are generated. These Messages can be from
different type (class). All Messages are sent first to a dispatcher in
the Control Subsystem. The dispatcher send them to subscribed
Control-Classes. The Control-Classes react to the messages.
The Control-Classes can be dynamically subscribed or unsubscribed to the
dispatcher. Now there is used a design pattern called Visitor, so that
the dispatcher can decide what kind of message he got.
I can't change the design, i have to implement it in Ada. It is already
imlemented in C++.
here is some code ...
-- Event.ads
with Class_EventVisitor; use Class_EventVisitor;
package Class_Event is
type Event is tagged null record;
type Event_Pointer is access all Event'Class;
procedure acceptVisitor( this : in Event_Pointer; visitor : in
EventVisitor_Pointer ) is abstract;
end Class_Event;
-- Event.Message
with Class_EventVisitor; use Class_EventVisitor;
package Class_Event.Class_Message is
type Message is new Event with null record;
type Message_Pointer is access all Message'Class;
procedure acceptVisitor( this : in Message_Pointer;
visitor : in EventVisitor_Pointer );
end Class_Event.Class_Message;
-- Event.Message.PointMessage
with Class_EventVisitor; use Class_EventVisitor;
package Class_Event.Class_Message.Class_PointMessage is
type PointMessage is new Message with private;
type PointMessage_Pointer is access all PointMessage'Class;
procedure acceptVisitor( this : in PointMessage_Pointer;
visitor : in EventVisitor_Pointer );
function Create ... return PointMessage;
private
type PointMessage is new Message with record
...
end record;
end Class_Event.Class_Message.Class_PointMessage;
-- EventVisitor
with Class_Event.Class_Message.Class_PointMessage;
use Class_Event.Class_Message.Class_PointMessage;
package Class_EventVisitor is
type EventVisitor is tagged private;
type EventVisitor_Pointer is access all EventVisitor'Class;
procedure handlePointMessage ( this : in EventVisitor_Pointer;
pMessage : in PointMessage_Pointer )
is abstract;
-- other message types
...
private
type EventVisitor is tagged null record;
end Class_EventVisitor;
The Control-Class handling the PointMessage will inherit from the
EventVisitor.
next prev parent reply other threads:[~2003-05-26 8:05 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-23 9:20 circular unit dependency Mirko Aigner
2003-05-23 11:37 ` Jeffrey Creem
2003-05-23 12:12 ` David C. Hoos
2003-05-23 18:08 ` Stephen Leake
2003-05-24 22:12 ` Robert I. Eachus
2003-05-26 8:05 ` Mirko Aigner [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-01-04 18:31 R
2005-01-04 23:45 ` Randy Brukardt
2005-01-05 8:35 ` Martin Krischik
2005-01-05 8:55 ` Duncan Sands
2005-01-05 0:26 ` Stephen Leake
1998-05-26 0:00 Brendan Reville
1997-05-24 0:00 jdlopez
1997-05-24 0:00 ` Michael F Brenner
1997-05-25 0:00 ` Jon S Anthony
1997-05-26 0:00 ` John G. Volan
1997-05-26 0:00 ` Fergus Henderson
1997-05-27 0:00 ` Jon S Anthony
1997-05-28 0:00 ` John G. Volan
1997-06-01 0:00 ` John G. Volan
1997-05-31 0:00 ` Kevin Cline
1997-05-31 0:00 ` Matthew Heaney
[not found] ` <33932F31.4399@sprintmail.com>
1997-06-02 0:00 ` Matthew Heaney
1997-06-03 0:00 ` W. Wesley Groleau (Wes)
1997-06-03 0:00 ` John G. Volan
1997-06-03 0:00 ` John G. Volan
1997-06-05 0:00 ` Matthew Heaney
1997-06-05 0:00 ` John G. Volan
1997-06-06 0:00 ` Stephen Schmid
1997-05-31 0:00 ` John G. Volan
1997-06-01 0:00 ` Kevin Cline
1997-06-01 0:00 ` John G. Volan
1997-06-02 0:00 ` John G. Volan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox