comp.lang.ada
 help / color / mirror / Atom feed
From: Christopher Campise <crc@amherst.com>
Subject: Help again please...
Date: 1998/04/17
Date: 1998-04-17T00:00:00+00:00	[thread overview]
Message-ID: <3537AC42.FAF280C@amherst.com> (raw)


Please excuse my ignorance, but I am fairly new to Ada95...

Another question regarding Generic extensions; I have the packages as
follow:

-------------------
--base class: spec
-------------------
generic
   type Value_Class is private;

package Generic_Class is

   type Class is tagged private;

   procedure Set_Value(The_Widget : in out Class; The_Value : in
Value_Class);

private
   type Class is tagged
      record
         Some_Value : Value_Class;
      end record;
end Generic_Class;

------------------------
--widget package spec
------------------------
with Generic_Class;

generic
   with package Instance is new Generic_Class with private;

package Widget is
   type Class is new Instance.Class with private;
...
private
   type Class is new Instance.Class with
      record
         Index : Integer:
         Kind  : Integer;
      end record;
end Widget;

----------------------------
-- list widget package spec
----------------------------
with Widget;

generic
   with package Instance is new Widget with private;

package List_Widget is
   type Class is new Instance.Class with private;
...
private
   type Class is new Instance.Class with
      record
         Item_Count : Integer;
      end record;
end List_Widget;

-------------------------
-- Dialog package spec
-------------------------
with List_Widget;

generic
   with package Instance is new List_Widget with private;

package Dialog is
   type Class is new Instance.Class with null record;
end Dialog;

-------------------------
-- Dialog package body
-------------------------
package body Dialog is

   List1 : Class;
   List2 : Class;

begin
...
   --do some list manipulations

   Final_Class.Set_Value(Widget => List1, The_Value => 1);

   -- I run into problems here.  I have to call my procedure from
generic_class but I receive a compiler error stating that " '1' is not a

   -- value/variable of
final_class.instance.instance.instance.generic_class."  How do I tell
that procedure to accept a certain type for that
   -- param?  This is the proc. that I want all children to inherit
generically.
...
end Dialog;

---------------------------
-- Driver procedure body
---------------------------

with Final_Class
procedure Driver is

begin

--how do I call a procedure from Final_Class from within here?

end Driver;

I know this may be ugly, but I just want to know if it's possible...or
realistic.

I appreciate any info on this situation.

--
Christopher Campise, Associate Engineer
Amherst Systems Inc.
30 Wilson Road
Buffalo, NY 14221
phone:  (716)631-0610 x384
E-Mail: crc@amherst.com
WWW: www.amherst.com






                 reply	other threads:[~1998-04-17  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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