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: Stephen Leake Subject: Re: Help on arrays of tagged types Date: 1998/01/09 Message-ID: <34B66513.11D@gsfc.nasa.gov>#1/1 X-Deja-AN: 314373484 Content-Transfer-Encoding: 7bit References: <34B37A65.607798A2@catalina-inter.net> Content-Type: text/plain; charset=us-ascii Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Mime-Version: 1.0 Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1998-01-09T00:00:00+00:00 List-Id: mrada wrote: > > Hi all, > > 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. ^^^ key word; "point". Use an array of class-wide access type; type Root_Type is abstract tagged with null record; type Root_Access_Type is access Root_Type'class; type Heterogenous_Array_Type is array (foo) of Root_Access_Type; Yes, this requires allocate/deallocate; that's the price you pay for flexibility. If the array elements are constant, they can be staticly declared, avoiding allocate/deallocate. > Chris Sparks -- - Stephe