comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Help on arrays of tagged types
Date: 1998/01/09
Date: 1998-01-09T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680000901982029460001@news.ni.net> (raw)
In-Reply-To: 34B37A65.607798A2@catalina-inter.net


In article <34B37A65.607798A2@catalina-inter.net>, mrada
<mrada@CATALINA-INTER.NET> 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).

--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271




  parent reply	other threads:[~1998-01-09  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-07  0:00 Help on arrays of tagged types mrada
1998-01-09  0:00 ` Stephen Leake
1998-01-09  0:00 ` Matthew Heaney [this message]
1998-01-09  0:00   ` Matthew Heaney
1998-01-13  0:00     ` James and Jessica Bear
1998-01-13  0:00       ` Matthew Heaney
replies disabled

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