comp.lang.ada
 help / color / mirror / Atom feed
From: randhol+abuse@pvv.org (Preben Randhol)
Subject: Re: Question about Finalization Control and reference counting
Date: Thu, 26 Apr 2001 08:50:17 +0000 (UTC)
Date: 2001-04-26T08:50:17+00:00	[thread overview]
Message-ID: <slrn9efod3.13l.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: 3AE74E17.FD004E37@boeing.com

On Wed, 25 Apr 2001 22:22:15 GMT, Jeffrey Carter wrote:
> 
> Perhaps I'm trying to be too user friendly. Or maybe I'm failing. For a
> real list component, Node would not be controlled, but the list type
> would.
> 
> A list component will generally not make its access type visible to its
> clients. All modification of a list will be through the operations
> provided, so freeing space when a node is deleted can be handled
> properly through those operations. You would rather want to define
> Adjust and Finalize for an entire List, to ensure that memory is managed
> properly.

Yes :-) After thinking a bit yesterday I did exactly this :-). Made the
Node types all private and added an itterator to the List so I can do:

Goto_First (List); Goto_Next (List); Goto_Previous (List); Goto_Last (List);

etc... (Prepending Goto so I don't mess with possible variable name space.)

and then I have : Get_Element (List) return Data_Type; which gives the
Data_Type (not the access value) in the Node the itterator is pointing
at at the moment.

As the Data_Type is generic it will then be up to the user to apply
Finaliaztion control on the Data_Type and then everything is ok if I
remove a Node.

Now I'll add Finalization to the List object :-)


Thanks everybody for much valued help!

-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 �For me, Ada95 puts back the joy in programming.�



  reply	other threads:[~2001-04-26  8:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-21 12:37 Question about Finalization Control and reference counting Preben Randhol
2001-04-21 12:44 ` Preben Randhol
2001-04-24 16:11   ` Jeffrey Carter
2001-04-25 15:58     ` Preben Randhol
2001-04-25 16:01       ` Preben Randhol
2001-04-25 22:22       ` Jeffrey Carter
2001-04-26  8:50         ` Preben Randhol [this message]
2001-04-25 16:57     ` Stanley R. Allen
2001-04-24 16:10 ` Alexander Boucke
2001-04-25  3:14 ` DuckE
  -- strict thread matches above, loose matches on Subject: below --
2001-04-25 11:08 Christoph Grein
replies disabled

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