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-Thread: 103376,6a6d9b5a811a96b3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "Adrian Hoe" Newsgroups: comp.lang.ada Subject: Re: How to access parent class/object? Date: 25 Mar 2005 00:10:33 -0800 Organization: http://groups.google.com Message-ID: <1111738233.319058.319790@g14g2000cwa.googlegroups.com> References: <1111733830.271744.235420@f14g2000cwb.googlegroups.com> <1a1i0bsj6w543.qanvlsnuodfy$.dlg@40tude.net> NNTP-Posting-Host: 219.95.230.55 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1111738237 3518 127.0.0.1 (25 Mar 2005 08:10:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Mar 2005 08:10:37 +0000 (UTC) In-Reply-To: <1a1i0bsj6w543.qanvlsnuodfy$.dlg@40tude.net> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=219.95.230.55; posting-account=LKUaWwwAAABzCo8SD2jIIt5LtkPzH8ot Xref: g2news1.google.com comp.lang.ada:9974 Date: 2005-03-25T00:10:33-08:00 List-Id: Thanks Dmitry. I have just posted the solution. I did not think hard enough. Sorry, anyway thanks again. Cheers, -- Adrian Hoe Dmitry A. Kazakov wrote: > 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