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.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: mheaney@ni.net (Matthew Heaney) Subject: Re: Help on arrays of tagged types Date: 1998/01/09 Message-ID: #1/1 X-Deja-AN: 314542104 Content-Transfer-Encoding: 8bit References: <34B37A65.607798A2@catalina-inter.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1998-01-09T00:00:00+00:00 List-Id: In article , mheaney@ni.net (Matthew Heaney) wrote: >In article <34B37A65.607798A2@catalina-inter.net>, mrada > wrote: > >>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. > >You have to use indirection. > >type Root_Data is tagged null record; > >type Root_Data_Access_All is access all Root_Data; > >type Root_Data_Array is > array (Positive range <>) of Root_Data_Access_All; > >Note that use of heap is _not_ required, if you use a general access type >(as I have indicated in my example). Oops! Of course I meant 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; -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271