comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Q Controlled Types
Date: 1997/06/14
Date: 1997-06-14T00:00:00+00:00	[thread overview]
Message-ID: <EBrrKs.Aw3@world.std.com> (raw)
In-Reply-To: 5ns30g$9ui@news.Informatik.Uni-Oldenburg.DE


In article <5ns30g$9ui@news.Informatik.Uni-Oldenburg.DE>,
Guido Schumacher <Guido.Schumacher@Informatik.Uni-Oldenburg.DE> wrote:
>My intention is to preserve information of a target object in an
>assignment. The information (containing a protected object) is stored
>in an object which can be accessed by an access type.  A pointer of
>that access type is a record component of the controlled type.  If it
>were obvious that a call of finalize is not part of an assignment it
>would be possible to deallocate the object containing the static
>information.  The controlled object and the static object would both
>have the same lifetime.

Ada's controlled types can't do that directly.

Instead, you probably want to declare a limited controlled type with two
components: the pointer you want to preserve, plus a non-limited (maybe
controlled?) component containing all the other stuff.  Do your
assignments on that second component.  Finalize of that (if it's needed
at all) can do whatever you need it to do, and Finalize of the outer
(limited) thing can deallocate the protected object pointed at by the
pointer.

- Bob




  reply	other threads:[~1997-06-14  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 Q Controlled Types Guido Schumacher
1997-06-14  0:00 ` Robert A Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-06-05  0:00 Guido Schumacher
1997-06-06  0:00 ` Anonymous
1997-06-07  0:00   ` Robert A Duff
1997-06-06  0:00 ` Mark A Biggar
replies disabled

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