comp.lang.ada
 help / color / mirror / Atom feed
* Re: Record Representation clauses with variant records?
       [not found] <01BDC7CA.487BDC40@usr53-dialup35.mix1.Bloomington.mci.net>
@ 1998-08-15  0:00 ` Tom Moran
  0 siblings, 0 replies; only message in thread
From: Tom Moran @ 1998-08-15  0:00 UTC (permalink / raw)


>Is there a way of defining a record representation clause for a variant =
>record?
An example used by the CLAW demo:
        type Actual_Color_Type(Kind : Color_Type_Kinds := RGB_Kind) is
record
            case Kind is
                when Index_Kind =>
                    Palette_Index: Palette_Index_Type;
                when RGB_Kind | Palette_RGB_Kind =>
                    Red,
                    Green,
                    Blue   : Color_Intensities;
                when Invalid_Kind =>
                    null;
            end case;
        end record;

        for Actual_Color_Type use record
            Red           at 0 range 0 .. 7;
            Green         at 1 range 0 .. 7;
            Blue          at 2 range 0 .. 7;
            Kind          at 3 range 0 .. 7;
            Palette_Index at 0 range 0 .. 15;
        end record;





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-08-15  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <01BDC7CA.487BDC40@usr53-dialup35.mix1.Bloomington.mci.net>
1998-08-15  0:00 ` Record Representation clauses with variant records? Tom Moran

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