comp.lang.ada
 help / color / mirror / Atom feed
* Object with zero bits
@ 2004-10-13  6:15 Robert C. Leif
  2004-10-13 14:59 ` Nick Roberts
  2004-10-13 15:18 ` Wojtek Narczynski
  0 siblings, 2 replies; 7+ messages in thread
From: Robert C. Leif @ 2004-10-13  6:15 UTC (permalink / raw)
  To: comp.lang.ada

   For the Ada implementation of the binary data part of CytometryML, I am
using a discriminant to control a variant record where I need to store an
object with a zero storage size.  Instead of null, I would like a record
with an object of 0 bits (Empty_Var). I have about 12 parameters and would
like to be able to have the user determine which ones he or she will store.

   If all else fails, I can make a Boolean type that corresponds to one bit
in a 32 bit unsigned integer and simply consider this 32 bit unsigned
integer as excess baggage.. 
   I do have the luxury that I can wait for Ada 2005. Will this capacity be
in Ada 2005? If so, is there an example?
   
   type Fl_530_Rec_Type(Choice: Boolean) is
      record
         case Choice is
            when True =>
               Part:Fl_530_Type  := 0; --16 bit unsigned integer.
            when False =>
               null; --Empty_Var:Empty_Type;
         end case;
      end record;
   
   Another approach, which I am trying to avoid is to store the data as a
stream that contains different data-types.
   Thank you.
   Bob Leif 




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

end of thread, other threads:[~2004-10-14 14:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-13  6:15 Object with zero bits Robert C. Leif
2004-10-13 14:59 ` Nick Roberts
2004-10-13 15:18 ` Wojtek Narczynski
     [not found]   ` <ckjns1$342$1@a1-hrz.uni-duisburg.de>
     [not found]     ` <2t5jo2F1s56mgU1@uni-berlin.de>
2004-10-14  0:47       ` Georg Bauhaus
2004-10-14  2:14         ` Nick Roberts
2004-10-14 14:55           ` Georg Bauhaus
2004-10-14  8:13     ` Martin Krischik

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