From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,f196003f7b36852b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-26 01:50:18 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.skycache.com!Cidera!news100.world-online.no!news100.world-online.no!nntp.newmedia.no!news.powertech.no!uninett.no!ntnu.no!randhol+abuse From: randhol+abuse@pvv.org (Preben Randhol) Newsgroups: comp.lang.ada Subject: Re: Question about Finalization Control and reference counting Date: Thu, 26 Apr 2001 08:50:17 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3AE5A5B5.4337CE90@boeing.com> <3AE74E17.FD004E37@boeing.com> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: tyfon.itea.ntnu.no 988275017 15536 129.241.83.82 (26 Apr 2001 08:50:17 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Thu, 26 Apr 2001 08:50:17 +0000 (UTC) User-Agent: slrn/0.9.7.0 (Linux) Xref: newsfeed.google.com comp.lang.ada:6944 Date: 2001-04-26T08:50:17+00:00 List-Id: 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.�