comp.lang.ada
 help / color / mirror / Atom feed
* have to use unrestricted access but just what about access
@ 2002-06-19 23:32 chris.danx
  2002-06-20  8:41 ` chris.danx
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: chris.danx @ 2002-06-19 23:32 UTC (permalink / raw)


Hi,

How can the unrestricted_access attribute be replaced by just access in the
following code?

procedure on_create (window : in out dot_window) is
begin
   ...
   -- watcher is a task which uses key_coordinator
   -- (a protected object) to record certain keypresses
   -- which another task retrieves and does it's thing
   -- with.
   --
   Window.Watcher
     := new Dot_Key_Watcher.Watcher
       (Window.Key_Coordinator'Unrestricted_Access);
   ...
end on_create;


-- this is the window where watcher and key_coordinator live.
--
type Dot_Window
  is new Gwindows.Windows.Main.Main_Window_Type
 with record
    Drawing_Surface : Gwindows.Drawing_Panels.Drawing_Panel_Type;

    Key_Coordinator : aliased Dot_Key_Coor.Coordinator;
    Watcher         : Dot_Key_Watcher.Watcher_Access;
    Builder         : Dot_Builder.Builder_Access;
 end record;


I understand what is meant by "non-local pointer cannot point to local
object" in the case of 'access I just can't think of a way to fix it.

It's really just curiosity, (the code is limited to GNAT anyway!) it'd just
be nice to find out a more general solution since this problem could arise
elsewhere.


Chris





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-07-21  8:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-19 23:32 have to use unrestricted access but just what about access chris.danx
2002-06-20  8:41 ` chris.danx
2002-06-20 12:10 ` SteveD
2002-06-20 14:22 ` Robert A Duff
2002-06-21 11:45   ` Robert Dewar
2002-06-22  0:49     ` Robert A Duff
2002-06-22  1:05       ` Ted Dennison
2002-06-22 12:09         ` Robert Dewar
2002-07-20  4:59     ` Craig Carey
2002-07-20 17:47       ` Robert A Duff
2002-07-21  8:45         ` Craig Carey
2002-06-20 16:05 ` Robert Dewar
2002-06-20 17:11   ` chris.danx

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