comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>
Subject: Re: accessibility of objects
Date: Sun, 05 Dec 2010 11:16:09 +0100
Date: 2010-12-05T11:16:08+01:00	[thread overview]
Message-ID: <4cfb6668$0$6881$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <g96dnWSRONpxIGfRnZ2dnUVZ_o-dnZ2d@giganews.com>

On 12/4/10 11:17 PM, george wrote:
> ... this first package need to store items/records that are defined in the calling package.
> "type extension at deeper accessibility level than parent" or something else problem.
> I just want this utility program to store essentially in old language a pointer to my object, and dont care about the structure of the object, and then return me the pointer att appropriate time.

A message like this may mean two things:

1. there is a derived type L defined local
to some subprogram.

2. an object of this local type L has been
allocated and is to be referred to from the
outside.

That is, some place more global, perhaps your package,
defines the ancestor type P of L. Maybe some type
of pointers to P'Class, too, say Ref.

If you'd to try to assign the local object to a
pointer of global type Ref then after the subprogram
has finished, the pointer would be pointing to an
object whose type no longer exists, since its type  (L)
was defined local to this subprogram.

In this case, you'd need to view convert the local object
of type L to an object of the ancestor type P (using a view
conversion) and then take its pointer.

(What software are you using for posting? NNTP
clients respect very long lines; this renders
quoting a bit difficult.)



      parent reply	other threads:[~2010-12-05 10:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04 22:17 accessibility of objects george
2010-12-04 23:35 ` Ludovic Brenta
2010-12-05 10:16 ` Georg Bauhaus [this message]
replies disabled

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