comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Behavior of Stream Attributes On Access Types.
Date: 14 Jun 2002 19:27:39 +0100
Date: 2002-06-14T19:27:39+01:00	[thread overview]
Message-ID: <x7vhek5sokk.fsf@pushface.org> (raw)
In-Reply-To: ae7oo4$7ob$1@nh.pace.co.uk

"Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> writes:

> package Level_1 is
>     type L1 is tagged record
>         A : Integer ;
>     end record ;
>     --
>     --  Here I have L1'Read, L1'Write, L1'Input, L1'Output
>     --  and L1'Class'Read L1'Class'Write L1'Class'Input L1'Class'Output
>     --
> end Level_1 ;
> 
> package Level_1.Level_2 is
>     type L2 is new Level_1.L1 with record
>         B : Some_Access_Type := null ;
>     end record ;
>     --
>     --  Now I have to define my own 'Read and 'Write

I think this is where the mistake occurs.

At the point where you declared Some_Access_Type, declare

  procedure My_Read
    (Stream : access Ada.Streams.Root_Stream_Type'Class;
     Obj : Some_Access_Type);
  for Some_Access_Type'Read use My_Read;

and also for My_Write, and all magically happens ..



  parent reply	other threads:[~2002-06-14 18:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10 19:38 Behavior of Stream Attributes On Access Types Marin David Condic
2002-06-11  5:33 ` R. Tim Coslet
2002-06-11 14:15   ` Marin David Condic
2002-06-11 13:47 ` Ted Dennison
2002-06-11 14:27   ` Marin David Condic
2002-06-11 14:37     ` Marin David Condic
2002-06-12 14:19       ` David C. Hoos
2002-06-12 15:18         ` Marin David Condic
2002-06-13  3:00           ` David C. Hoos, Sr.
2002-06-14 18:27           ` Simon Wright [this message]
2002-06-14 18:53             ` Marin David Condic
2002-06-15 14:56               ` Simon Wright
2002-06-16  2:27                 ` Randy Brukardt
2002-06-17 14:31                   ` Marin David Condic
2002-06-18 19:30                     ` Randy Brukardt
2002-06-12 19:39       ` Randy Brukardt
2002-06-12 13:31     ` Ted Dennison
2002-06-11 21:56   ` Randy Brukardt
2002-06-12  3:44 ` David C. Hoos, Sr.
replies disabled

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