From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ac1d8bc704e79f7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-10 01:12:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Dispatching problem. Date: Mon, 10 Feb 2003 10:12:13 +0100 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1044868333 43702085 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:33950 Date: 2003-02-10T10:12:13+01:00 List-Id: On 7 Feb 2003 06:55:49 -0800, petter.fryklund.konsult@dynamics.saab.se (Petter Fryklund) wrote: >Another way to explain our problem: a message (of which there are >several variants) is received from another system in unit P. It is >forwarded to unit B which decodes to message using procedures in >package A. Package A can also be used for coding of outbound messages >and for producing trace of messages contents, both inbound and >outbound. We would like to dispatch both coding and tracing in A and >subsequent usage of the decoded message in B. Perhaps inbound messages >and outbound should be treated differently? In the original post there >is a 1-to-1 relationship between ie B.B1 and A.M1. They have the same >contents, apart from the tag. So, how do make an A.M1 a B.B1 (or >really an A.Msg a B.Msg?)so that we can dispatch in code written in >package B? (Dispatching in B ;-) First of all, Ada does not have multiple inheritance, so B.Msg have to be in A.Msg. What is wrong with the following design? package A is type Msg is abstract tagged null record; procedure Y (X : in out Msg) is abstract; type M1 is new Msg with ...; procedure Y (X : in out Msg); type M2 is new Msg with ...; procedure Y (X : in out Msg); end A; with A; package B is type M1 is new A.M1 with ...; procedure Y (X : in out M1); type M2 is new A.M2 with ...; procedure Y (X : in out M2); end B; BTW, the package B looks superfluos, as it possibly is, if you are saying that A.Mi = B.Mi. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de