type Root is abstract tagged limited null record;  -- base class

  type Parent is new Root with record ...            -- uncontrolled hierarchy

  type Derived is new Parent with record ...         -- still uncontrolled
--procedure Initialize (X: in out Derived);
  procedure Finalize   (X: in out Derived);

  package Add_Control is                             -- create the
    new Add_Finalization.To_Limited_Uncontrolled     -- controlled
      (Derived, --Initialize,                        -- type
       Finalize);                                    -- Controlled
  use Add_Control;

  type Final is new Controlled with record ...       -- further derivation
--procedure Initialize (X: in out Final);
  procedure Finalize   (X: in out Final);

Back to text.
Zurück zum Text.