comp.lang.ada
 help / color / mirror / Atom feed
* Pass a serial port as user data in a GTK callback handler?
@ 2014-02-15 23:32 hreba
  2014-02-16  0:35 ` Jeffrey Carter
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: hreba @ 2014-02-15 23:32 UTC (permalink / raw)


Hi,

I am new to Ada and still overwhelmed by the complexity of the language.

My actual programming exercise has a GTK GUI, and I want a callback 
handler to communicate through a serial port, so I need to pass the port 
in my user data, which must be of

    type User_Type (<>) is private;

which means it must be nonlimited.

But GNAT.Serial_Communications.Serial_Port is limited:

    type Serial_Port is new Ada.Streams.Root_Stream_Type with private;
    type Root_Stream_Type is abstract tagged limited private;

I tried to pass a reference to the port, and it must be an "access all" 
(because it is not allocated by my, but a preexisting variable (hardware 
resource), as I understand it):

    port: access all GNAT.Serial_Communications.Serial_Port;

But then I get an error message

    "all" is not permitted for anonymous access types.

Is there a solution?
-- 
Frank Hrebabetzky		+55 / 48 / 3235 1106
Florianopolis, Brazil

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

end of thread, other threads:[~2014-02-20 16:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 23:32 Pass a serial port as user data in a GTK callback handler? hreba
2014-02-16  0:35 ` Jeffrey Carter
2014-02-16 16:18   ` hreba
2014-02-16  7:45 ` Niklas Holsti
2014-02-16 16:14   ` hreba
2014-02-16  9:20 ` Dmitry A. Kazakov
2014-02-16 16:57   ` hreba
2014-02-16 18:02     ` Dmitry A. Kazakov
2014-02-17 16:13 ` adambeneschan
2014-02-17 16:20   ` adambeneschan
2014-02-17 21:31     ` Robert A Duff
2014-02-19  0:53       ` Randy Brukardt
2014-02-19 22:22         ` Robert A Duff
2014-02-20  0:34           ` Randy Brukardt
2014-02-20 11:07             ` Simon Wright
2014-02-20 16:11             ` Robert A Duff

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