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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6a6d9b5a811a96b3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!news.netcologne.de!newsfeed-fusi.netcologne.de!151.189.20.20.MISMATCH!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: How to access parent class/object? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1111733830.271744.235420@f14g2000cwb.googlegroups.com> Date: Fri, 25 Mar 2005 08:48:24 +0100 Message-ID: <1a1i0bsj6w543.qanvlsnuodfy$.dlg@40tude.net> NNTP-Posting-Date: 25 Mar 2005 08:48:19 MET NNTP-Posting-Host: 46cd1959.newsread4.arcor-online.net X-Trace: DXC=Ng9kQ:nBaTn<_V8dMIHdjh:ejgIfPPlddjW\KbG]kaMhFYk:AnJB[CmPXoREVTK4Ml[6LHn;2LCVnVVa[ZlQni_alcUQSf_TZHa X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9971 Date: 2005-03-25T08:48:19+01:00 List-Id: On 24 Mar 2005 22:57:10 -0800, Adrian Hoe wrote: > Hi, > > I have the following codes (abbreviated): > > package A is > type A_Object is tagged private; > ... > end A; > > package B is > type B_Object is new A_Object with private; > ... > end B; > > package C is > type C_Object is new B_Object with private; > ... > end C; > > package D is > type D_Object is new C_Object with private; > ... > end D; > > Now, I have the following declaration: > > My_D_Object is D.D_Object; > > How can I reference the parent objects? > > procedure Process_C (C_Obj : access C_Object); > procedure Process_D (D_Obj : access D_Object); > > How can I pass C_Object and D_Object into Process_C and Process_D > respectively given only My_D_Object is D.D_Object? My_D_Object : aliased D_Object := ...; Process_C (C_Object (My_D_Object)'Access); Process_D (My_D_Object'Access); -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de