From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,330ec86e1824a689,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-27 23:54:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!eurocyber.net!newsfeed.muc.eurocyber.net!newsfeed.stueberl.de!teaser.fr!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: Run-Time Type Assignment Date: Tue, 27 Aug 2002 23:53:29 -0700 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1030517642 44168 137.194.161.2 (28 Aug 2002 06:54:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 28 Aug 2002 06:54:02 +0000 (UTC) Return-Path: X-Envelope-From: rleif@rleif.com X-Envelope-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.12 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:28473 Date: 2002-08-27T23:53:29-07:00 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.