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:37:25 -0800
Date: 2002-11-08T20:37:25+00:00	[thread overview]
Message-ID: <1ec946d1.0211081237.6db8d845@posting.google.com> (raw)
In-Reply-To: 3dc9ec63$0$300$bed64819@news.gradwell.net

porton@ex-code.com (Victor Porton) wrote in message news:<3dc9ec63$0$300$bed64819@news.gradwell.net>...
> 
> I noticed Access_Current_Item, but with it to gain such access one
> needs to create a new procedure! Too bad. I want direct access like:
> 
> function Current_Item_Access(It: Iterator'Class) return Item_Access;

The Charles library does indeed have 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 do this:

   function To_Access is new Generic_Element (...);

   declare
     E : Element_Subtype renames To_Access (Iterator).all;
   begin
     <now you have access to actual object>
   end;

The library is hosted at my web page:

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



  parent reply	other threads:[~2002-11-08 20:37 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 [this message]
2002-11-08  5:21 ` Victor Porton
2002-11-08 20:53   ` Matthew Heaney
2002-11-08 20:33 ` Matthew Heaney
replies disabled

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