comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Generic and Access problem
Date: Thu, 9 Jan 2003 12:03:42 +0100 (MET)
Date: 2003-01-09T12:03:42+01:00	[thread overview]
Message-ID: <mailman.1042110662.21576.comp.lang.ada@ada.eu.org> (raw)

generic

   type Item_Type is private;
   type Index_Type is (<>);

package Generic_Pool is

   type Id_Type is private;
   type Reference_Type is access all Item_Type;

   -- There is no operation by which an object of type Id_Type
   -- can get a value.
   -- So how is an object of Item_Type supposed to be stored in Buf?
   -- If you've solved this problem, perhaps your problem with pointer
   -- lifetime is also solved.

   function Item (P: Id_Type; Ix: Index_Type) return Reference_Type;

private

   type Buffer_Type is array (Index_Type) of aliased Item_Type;

   type Id_Type is
   record
      Buf               : Buffer_Type;
      None_Allocated_Yet: Boolean    := True;
      Last_Used         : Index_Type := Index_Type'First;
   end record;
   
end Generic_Pool;

Why don't you you use System.Storage_Pools RM 13.11?



             reply	other threads:[~2003-01-09 11:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-09 11:03 Grein, Christoph [this message]
     [not found] <avjgbd$m7e$1@newstoo.ericsson.se>
2003-01-09 14:13 ` Generic and Access problem David C. Hoos
  -- strict thread matches above, loose matches on Subject: below --
2003-01-09 10:33 Sebastian Madunic
2003-01-09 10:10 Grein, Christoph
replies disabled

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