comp.lang.ada
 help / color / mirror / Atom feed
* Run-Time Type Assignment
@ 2002-08-28  6:53 Robert C. Leif
  2002-08-28 11:04 ` Robert Dewar
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Robert C. Leif @ 2002-08-28  6:53 UTC (permalink / raw)


From: Bob Leif
To: Fellow readers of Comp.Lang.Ada
Introduction: Cytometry instruments are employed for blood cell counts
and measuring parameters related to cancer and other diseases. I am now
trying to create a binary file for my work on CytometryML. CytometryML
is a collection of XML schemas that will be used for cytometry data. The
original Flow Cytometry Standard and its implementations permitted the
operator of an instrument at run-time to select both the number of
parameters and types of parameters to be used as elements in a record.
Each instrument has a maximum number of parameters. The data types for
these parameters were already compiled. An array of these records was
then created from the instrument's measurements and subsequently stored.
I am not defending the inclusion of this capability in a clinical
instrument. However, it is perceived as required for a research
instrument. The maximum number of records that I have specified for
CytometryML is two billion. Therefore, the implementation should be
space efficient.
Problem: Two possible approaches for the creation of this record are to
use a tagged record or a variant record. I do not know how to select a
subtype of a class at run-time. The variant record approach possibly
would have worked in Pascal; however, it did not compile in the
cost-free GNAT compiler.
---------------------------------------------------
--Variant Record Approach
--Does not work
   type Parameter_Rec_Psuedo_Tagged_Type (Num_Parameters :
Num_Parameters_Type) is --range 1..2
   record
      case Num_Parameters  is
         when 1 =>
            Parameter_1: Parameter_1_Type;
         when 2 =>
            Parameter_1: Parameter_1_Type;
 		--Parameter_1 conflicts with declaration 2 lines above.
            --Can not have the same signature as the one above.
            Parameter_2: Parameter_2_Type;         
      end case;
   end record;

-----------------------------------------------------
-- tagged record
package Array_Of_Records_Class_Pkg is new Array_Of_Records_G_Pkg(
   Length      => Num_Of_Records,   
   Record_Type => Record_Type'Class); 
--Bombs because "Actual for "Record_Type" must be a definitive subtype"
--How can I make this dispatch based the Num_Parameters?
---------------------------------------------------
One unconventional approach, which because of the increase in computer
speed might now work, is at run-time to create the small amount of Ada
code needed, compile it, and link it. The user need not be aware of this
possibly bizarre approach. 

My application may have some generality because this type of type
assignment (for want of a better term) conceivably could be used for
spreadsheets and data bases. This is not a recommendation.
Thank you.





^ permalink raw reply	[flat|nested] 33+ messages in thread
[parent not found: <002a01c24e5f$9ee347b0$789a0844@robertqgx6k4x9>]
[parent not found: <005101c24ea9$0de9c960$789a0844@robertqgx6k4x9>]

end of thread, other threads:[~2002-08-30 22:54 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-28  6:53 Run-Time Type Assignment Robert C. Leif
2002-08-28 11:04 ` Robert Dewar
2002-08-28 13:35   ` Robert A Duff
2002-08-28 14:56     ` Larry Kilgallen
2002-08-28 14:31       ` Robert A Duff
2002-08-28 14:59         ` Lutz Donnerhacke
2002-08-28 22:32           ` Robert A Duff
2002-08-29 22:55           ` Dmitry A.Kazakov
2002-08-28 18:03         ` Frank J. Lhota
2002-08-28 18:37           ` Pat Rogers
2002-08-28 22:47           ` Robert A Duff
2002-08-29 13:32             ` Ben Brosgol
2002-08-29 13:52               ` SIMON Claude
2002-08-29 14:30                 ` Robert A Duff
2002-08-29 18:27                   ` Randy Brukardt
2002-08-29 14:56               ` Robert A Duff
2002-08-30  3:04                 ` Ben Brosgol
2002-08-30 22:54                   ` Robert A Duff
2002-08-29 15:09               ` Larry Kilgallen
2002-08-29 14:29                 ` Marin D. Condic
2002-08-28 13:41 ` Robert A Duff
2002-08-28 17:15 ` Hyman Rosen
2002-08-28 20:27 ` Björn Lundin
     [not found] <002a01c24e5f$9ee347b0$789a0844@robertqgx6k4x9>
2002-08-28 11:33 ` sk
     [not found] ` <3D6CB4F5.F4E05D76@myob.com>
2002-08-28 11:37   ` sk
2002-08-28 15:39   ` Robert C. Leif
2002-08-28 18:53     ` Jeffrey Carter
2002-08-28 20:54   ` Robert C. Leif
2002-08-28 22:55     ` Robert A Duff
2002-08-29  3:18       ` Robert C. Leif
     [not found] <005101c24ea9$0de9c960$789a0844@robertqgx6k4x9>
2002-08-28 16:06 ` sk
2002-08-28 22:44   ` tmoran
2002-08-29  0:37   ` tmoran

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