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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,30821ecf97416798 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-04 01:55:51 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: How Can I Create A Class Dynamically Date: Thu, 4 Oct 2001 08:55:24 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <1bJr7.11813$po4.573186@e420r-atl1.usenetserver.com> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1002185724 29318 217.17.192.37 (4 Oct 2001 08:55:24 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Thu, 4 Oct 2001 08:55:24 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:13709 Date: 2001-10-04T08:55:24+00:00 List-Id: * R. Tim Coslet wrote: >lutz@iks-jena.de (Lutz Donnerhacke) wrote in message news:... >> * Anthony E. Glover wrote: >> >I have a class hierarchy defined and I would like to be able to read a >> >string and then dynamically creating a pointer to an object of the type >> >specified by the string. Similar I think to class loading and class >> >factories in Java. Can this be done in Ada95. If so, how. I have looked at >> >the Ada.Tags packages and this looks like it might be helpfull, but I'm not >> >quite sure how to make use of it. I would basically like to be able to avoid >> >having to specify a case statement or if block when initially creating my >> >objects. >> >> IMHO this is not possible, due to missing typeness. > >Have you looked at the package Ada.Streams.Stream_IO ? > >This package was designed specifically to allow input/output of tagged >types (the file is NOT a text file however). I wonder if Stream_IO is able to read instances of derivated types unknown at the compile time of the programm. I'd look at the Objective-* Code.