comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Behavior of Stream Attributes On Access Types.
Date: Wed, 12 Jun 2002 11:18:24 -0400
Date: 2002-06-12T15:18:28+00:00	[thread overview]
Message-ID: <ae7oo4$7ob$1@nh.pace.co.uk> (raw)
In-Reply-To: mailman.1023891618.16755.comp.lang.ada@ada.eu.org

Yes. That was helpful. But I'm still curious about how it would be done with
the scenario I described because I want to understand the inheritance
issues. (I can see that it would be better to handle the access values as
you describe, but in a more "general" sense - can you describe what happens
with the 'Read and 'Write as we travel down the chain of inheritance?)

Here's some code snippets to illustrate the questions I have...

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
    --
    procedure My_Read ....
    for L2'Read use My_Read...
    procedure My_Write .....
    for L2'Write use My_Write...
    --
    --  Here I now have for free L2'Input, L2'Output
    --  Further L1'Class'Read L1'Class'Write L1'Class'Input L1'Class'Output
    --  will dispatch to My_Read and My_Write if an L2 parameter is passed?
    --
end Level_1.Level_2 ;

package Level_1.Level_2.Level_3 is
    type L3 is new Level_2.L2 with record
        C : Integer ;
    end record ;
    --
    --  Now must I define my own 'Read and 'Write???
    --
    procedure My_Read ....
    for L3'Read use My_Read...
    procedure My_Write .....
    for L3'Write use My_Write...
    --
    --  Or will a call to L1'Class'Write hit the "My_Write" from
    --  Level_2 to output the access type, then call the default
    --  'Write for the new "C" field?
    --
end Level_1.Level_2.Level_3 ;

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com


"David C. Hoos" <david.c.hoos.sr@ada95.com> wrote in message
news:mailman.1023891618.16755.comp.lang.ada@ada.eu.org...
>
> Did you look at my example of how I do it?
>
>
>





  reply	other threads:[~2002-06-12 15:18 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 [this message]
2002-06-13  3:00           ` David C. Hoos, Sr.
2002-06-14 18:27           ` Simon Wright
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