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,FREEMAIL_FROM, T_HK_NAME_FM_MR_MRS,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bbc77d6e9a74feb5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 21:58:43 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: ratsonjaniv@hotmail.com (Mr. J.) Newsgroups: comp.lang.ada Subject: Re: please help - access and inheritence Date: 8 Dec 2003 21:58:42 -0800 Organization: http://groups.google.com Message-ID: References: <3fd27939$1@news.barak.net.il> <1339724.UG9tll5RLS@linux1.krischik.com> NNTP-Posting-Host: 82.166.175.86 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1070949523 10279 127.0.0.1 (9 Dec 2003 05:58:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 9 Dec 2003 05:58:43 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:3258 Date: 2003-12-08T21:58:42-08:00 List-Id: 10x, but it still doesn't compiled : ========================================== for I in Arr'range loop Process : declare Current_Vehicle : Jr.Vehicle.Vehicle'Class renames Arr(I).all; begin if(Has_Exceeded(Current_Vehicle)) then Put_Line("Exceeded"); end if; end Process; end loop; =============================================== compile error : q1.adb:79:16: no candidate interpretations match the actuals: q1.adb:79:29: expected private type "Vehicle_Private" defined at jr-vehicle-private_car.ads:5 q1.adb:79:29: found type "Vehicle'Class" defined at jr-vehicle.ads:7 q1.adb:79:29: ==> in call to "Has_Exceeded" at jr-vehicle-private_car.ads:5(inherited) q1.adb:79:29: ==> in call to "Has_Exceeded" at jr-vehicle-passengers.ads:7 q1.adb:79:29: ==> in call to "Has_Exceeded" at jr-vehicle-load.ads:7 ------------------------------------------------------------------------- Martin Krischik wrote in message news:<1339724.UG9tll5RLS@linux1.krischik.com>... > Ratson Janiv wrote: > > > type Vehicleptr is access Jr.Vehicle.Vehicle'Class; > > An other poster allready pointed out that you need to use access all. > > > type Vehiclesarr is array (1..Maxvehilces) of Vehicleptr; > > > > Vp1,Vp2,Vp3,Vp4,Vp5: aliased Jr.Vehicle.Private_Car.Vehicle_Private; > > > > Arr(1) := Vehicleptr(Vp1'access); -- failed, why? please ... > > But maybee you would be better off using some container library i.E. the > booch components: > > http://www.pushface.org/components/bc > > and since you are trying to store > > Vehicle'Class you might also want to look at the indefinte extension at: > > http://adacl.sourceforge.net > > Examples: > > http://adacl.sourceforge.net/html > ______Include__AdaCL-SAR-Filter-Container__ads.htm > > http://adacl.sourceforge.net/html/sarDo-CommandLine__adb.htm#176_15 > > The interesting Part: You won't need any access any more. > > With Regards > > Martin