comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: non-library level finalization
Date: Mon, 21 Mar 2005 15:54:28 -0600
Date: 2005-03-21T15:54:28-06:00	[thread overview]
Message-ID: <VpOdnfiAMeCb36LfRVn-1Q@megapath.net> (raw)
In-Reply-To: eIKdnT-oNJ6gvqPfRVn-pA@comcast.com

<tmoran@acm.org> wrote in message news:eIKdnT-oNJ6gvqPfRVn-pA@comcast.com...
> I have a generic package that would benefit from doing some cleanup when
> an instantiation disappears.  It can't just declare a (private)
> Finalization_Controlled object because that would require all
> instantiations to be at library level.  Suggestions?

I forgot the obvious. The problem is not with a controlled *object*, but
rather declaring a controlled *type*. So, you can do this by declaring a
controlled type outside of the generic. Now, to make that useful, you'd have
to figure out some way to figure out how to do the needed actions inside of
the generic -- and *that* might prove difficult depending on what you need
done. (For instance, registering a handler would work, but it too would have
to be at library-level -- so you wouldn't have gained anything.)

For a lot of generics, restricting to library level isn't a major concern
(or, it's happened already, as is usually the case for tagged types). But
your case may be different.

                              Randy.






  parent reply	other threads:[~2005-03-21 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-21  1:28 non-library level finalization tmoran
2005-03-21  9:01 ` Martin Dowie
2005-03-21 13:09   ` Ada2005 again, was: " Tapio Kelloniemi
2005-03-21 14:59     ` Martin Dowie
2005-03-21 21:48       ` Randy Brukardt
2005-03-21 15:54 ` Robert A Duff
2005-03-21 21:42 ` Randy Brukardt
2005-03-21 21:54 ` Randy Brukardt [this message]
2005-03-21 22:37   ` tmoran
replies disabled

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