comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Booch: missing r/w access through iterators
Date: 8 Nov 2002 12:33:46 -0800
Date: 2002-11-08T20:33:47+00:00	[thread overview]
Message-ID: <1ec946d1.0211081233.fb278a9@posting.google.com> (raw)
In-Reply-To: 3dc92622$0$308$bed64819@news.gradwell.net

porton@ex-code.com (Victor Porton) wrote in message news:<3dc92622$0$308$bed64819@news.gradwell.net>...
> In Booch generic package BC.Containers there are
> function Current_Item which gives read-only access
> to the current item. Why a function giving direct
> read-write access to the current item (by returning
> access to it) is missing?!

The Charles library has such a function:

   generic
      type Element_Access is 
         access all Element_Type;
   function Generic_Element 
     (Iterator : Iterator_Type) return Element_Access;

This allows you to modify elements in place:

   type Element_Access is
     access all Element_Subtype;

   function To_Access is
     new Generic_Element (Element_Access);   

   declare
      E : Element_Type renames To_Access (Iterator).all;
   begin
      <now manipulate actual element object>
   end;

You can get the latest version of Charles at my home page:

http://home.earthlink.net/~matthewjheaney/charles/index.html



      parent reply	other threads:[~2002-11-08 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 14:18 Booch: missing r/w access through iterators Victor Porton
2002-11-06 16:42 ` Simon Wright
2002-11-07  4:21 ` Victor Porton
2002-11-07 21:04   ` Simon Wright
2002-11-08 20:49     ` Matthew Heaney
2002-11-08 20:37   ` Matthew Heaney
2002-11-08  5:21 ` Victor Porton
2002-11-08 20:53   ` Matthew Heaney
2002-11-08 20:33 ` Matthew Heaney [this message]
replies disabled

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