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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2cd78c85026e128 X-Google-Attributes: gid103376,public From: James and Jessica Bear Subject: Re: Help on arrays of tagged types Date: 1998/01/13 Message-ID: <34BC054C.5DB2@peak.org>#1/1 X-Deja-AN: 315703593 Content-Transfer-Encoding: 7bit References: <34B37A65.607798A2@catalina-inter.net> Mime-Version: 1.0 Reply-To: jamesjb@peak.org Content-Type: text/plain; charset=us-ascii Organization: The Bear Family Newsgroups: comp.lang.ada Date: 1998-01-13T00:00:00+00:00 List-Id: [ headers snipped ] > >>I am racking my brains trying to figure out how to have a hetergenous > >>array of tagged type data. I have numerous packages all of which have > >>a Data type inherited from one another. I would like to declare an > >>array who components can point to different "Data" type objects. > > [ snip ] Hello. This problem is quite similar to one I have been having also. I am trying to create a linked list type for objects derived from a root tagged type. The goal is to have a homogenous Linked_List object, that stores objects of a tagged type derived from "Root_Data". So you could set up as follows: Socket_List : Linked_List; Descriptor_List : Linked_List; etc. The list is set up analogously to the example below, but the problem arises when I try to access the elements of the list. I think the problem is that I try to convert from "access Root_Data'Class" to "access ", which cannot work because it would entail extending the structure of the object to the derived type. > > type Root_Data_Class_Access_All is access all Root_Data'Class; > > type Root_Data_Array is > array (Positive range <>) of Root_Data_Class_Access_All; > Should I be using generics for this instead? Thanks for any and all help. :) James