comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Finalization of tagged types - problem
Date: Mon, 13 Jan 2003 09:21:10 +0100 (MET)
Date: 2003-01-13T09:21:10+01:00	[thread overview]
Message-ID: <mailman.1042446542.5578.comp.lang.ada@ada.eu.org> (raw)

From: porton@ex-code.com (Victor Porton)

> I have a non-limited tagged type (not derived from
> Ada.Finalization.Controlled) Base.
> 
> I derive:
> 
> type State_Type is new Base with
>    record
>       -- ...
>       Finalizer: Finalizer_Type(State_Type'Access);
>    end record;
> 
> I want to add a component with back-reference derived
> from Ada.Finalization.Controlled or
> Ada.Finalization.Limited_Controlled for auto-finalization
> of State_Type.
> 
> But
> 
> type Finalizer_Type(State: access State_Type) is
>    new Ada.Finalization.Controlled with null record;
>    
> Compiler: "Access discriminant are allowed only for limited types".
> 
> Can be done something among the obvious but imperfect
> solutions: 1. make Base controlled. 2. make Base limited
> and derive Finalizer_Type from Limited_Controlled instead?

Victor,

I've published a few years ago in Ada Letters a paper "Add Finalization" dealing 
with this problem. You can find it online on my home page

<http://home.T-Online.de/home/Christ-Usch.Grein/Ada/Finalization.html>
                                                    ~~~~~~~~~~~~~~~~~
                                             Not exactly sure of this part
              If it fails, omit it and look for the title "Add Finalization"

HTH

Christoph



             reply	other threads:[~2003-01-13  8:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-13  8:21 Grein, Christoph [this message]
2003-01-13 11:28 ` Finalization of tagged types - problem Victor Porton
  -- strict thread matches above, loose matches on Subject: below --
2003-01-13 11:48 Grein, Christoph
2003-01-13  1:11 Victor Porton
replies disabled

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