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-02 16:13:33 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: rtcoslet@rockwellcollins.com (R. Tim Coslet) Newsgroups: comp.lang.ada Subject: Re: How Can I Create A Class Dynamically Date: 2 Oct 2001 16:13:32 -0700 Organization: http://groups.google.com/ Message-ID: References: <1bJr7.11813$po4.573186@e420r-atl1.usenetserver.com> NNTP-Posting-Host: 205.175.225.23 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1002064412 23550 127.0.0.1 (2 Oct 2001 23:13:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 2 Oct 2001 23:13:32 GMT Xref: archiver1.google.com comp.lang.ada:13656 Date: 2001-10-02T23:13:32+00:00 List-Id: 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). Even if Stream_IO isn't exactly what you are looking for you might find some clues here as to how to do what you need.