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,8a602a7f65bebaea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-17 07:39:56 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Abstract methods in ADA95 Date: Thu, 17 Oct 2002 14:39:55 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <20021017-143635-828420@foorum.com> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1034865595 5207 217.17.192.37 (17 Oct 2002 14:39:55 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Thu, 17 Oct 2002 14:39:55 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:29871 Date: 2002-10-17T14:39:55+00:00 List-Id: * Hector Hugo wrote: > Hello, i'm new programing in Ada95, i come from C++ world and i've got > problems when i try to use abstract methods in Ada95. I'm trying to do > something similar to this but in Ada95: > > class Abstract_Class > { > public: > virtual void Abstract_Method () = 0; // C++ abstract method. > > ... > }; type Abstract_Class is abstract tagged record ...; procedure Abstract_Method (a : Abstract_Class) is abstact; > class Son_Class: public Abstract_Class // C++ tagged type extension. > { > void Abstract_Method (); > > ... > }; type Son_Class is new Abstract_Class with record ...; procedure Abstract_Method (a : Son_Class); > void main () > { > Abstract_Class* p_abstract = new Son_Class; > > p_abstract->Abstract_Method (); > } procedure main is concrete : Abstract_Class'Class := Son_Class'(null record); begin Abstract_Method(concrete); end main;