From: "Robert C. Leif" <rleif@rleif.com>
To: <comp.lang.ada@ada-france.org>
Subject: Object with zero bits
Date: Tue, 12 Oct 2004 23:15:10 -0700
Date: 2004-10-12T23:15:10-07:00 [thread overview]
Message-ID: <mailman.299.1097648124.390.comp.lang.ada@ada-france.org> (raw)
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
next reply other threads:[~2004-10-13 6:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-13 6:15 Robert C. Leif [this message]
2004-10-13 14:59 ` Object with zero bits 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox