comp.lang.ada
 help / color / mirror / Atom feed
From: ratsonjaniv@hotmail.com (Mr. J.)
Subject: Re: please help - access and inheritence
Date: 8 Dec 2003 21:58:42 -0800
Date: 2003-12-08T21:58:42-08:00	[thread overview]
Message-ID: <fc116fae.0312082158.2f8b32ae@posting.google.com> (raw)
In-Reply-To: 1339724.UG9tll5RLS@linux1.krischik.com

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 <krischik@users.sourceforge.net> 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



  reply	other threads:[~2003-12-09  5:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-07  0:47 please help - access and inheritence Ratson Janiv
2003-12-07  7:14 ` tmoran
2003-12-07 18:44 ` Jeffrey Carter
2003-12-08  4:46   ` Mr. J.
2003-12-08 18:07     ` Jeffrey Carter
2003-12-08 19:05       ` Martin Krischik
2003-12-08 19:17     ` Martin Krischik
2003-12-08 18:50 ` Martin Krischik
2003-12-09  5:58   ` Mr. J. [this message]
2003-12-09 16:55     ` Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox