comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com (Tom Moran)
Subject: Re: Tagged Rep Spec
Date: 1999/06/15
Date: 1999-06-15T00:00:00+00:00	[thread overview]
Message-ID: <3766970e.273390@news.pacbell.net> (raw)
In-Reply-To: 7k5mop$n0i$1@nnrp1.deja.com

Though some compilers used to have troubles with this, it seems to
work now on the compilers I've tried.  
Tag_Size : constant := 4; -- compiler dependent stuff!
for Interrupt_Record_Type use
   record
     watchdog_warning   at 0+Tag_Size range 0..0;
     utility_clock               at 0+Tag_Size range 1..1;
     timer1                        at 0+Tag_Size range 2..2;
     rs232                         at 0+Tag_Size range 3..3;
     mailbox                      at 0+Tag_Size range 4..4;
   end record;

As MDC points out, it's very compiler dependent and non-portable.
Could you use
  type Inner_Record is ... -- not tagged
  for Inner_Record use ...
 type Interrupt_Record_Type is new ... with record
   Contents : Inner_Record;
end record;
  Usually you need to give rep specs because you are dealing with
external hardward or software that has its own ideas.  Usually such
hardware or software has no idea what a tag might mean, so you really
would rather communicate with it via Inner_Record than via a tagged
record.  If you really need the tag, perhaps you should use Streams
instead.




  parent reply	other threads:[~1999-06-15  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-15  0:00 Tagged Rep Spec jsanchor
1999-06-15  0:00 ` Marin David Condic
1999-06-15  0:00 ` Tom Moran [this message]
1999-06-16  0:00   ` jsanchor
1999-06-16  0:00 ` Matthew Heaney
1999-06-25  0:00   ` Robert Dewar
1999-06-28  0:00     ` Marin David Condic
replies disabled

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