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=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,b8b2de2a45e33b46 X-Google-Attributes: gid103376,public From: "Pascal Obry" Subject: Re: Usage of Ada.Streams Date: 2000/01/19 Message-ID: <863vhk$qje$1@wanadoo.fr>#1/1 X-Deja-AN: 574615640 References: <862lc7$s8a$1@inf2.informatik.uni-stuttgart.de> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 948273524 27246 193.250.41.38 (19 Jan 2000 09:18:44 GMT) Organization: home NNTP-Posting-Date: 19 Jan 2000 09:18:44 GMT Newsgroups: comp.lang.ada Date: 2000-01-19T09:18:44+00:00 List-Id: David C. Hoos, Sr. a �crit dans le message ... >If you want to have the tags in the stream (so that the specific >types can be distinguished when reading back), you need to use: >Data'Class'Output(Str, Data_Pointer.all); > >Then, to read them back, you would say: >Data_Pointer := new Data'Class'(Data'Class'Input (str)); > >That statement allocates memory for the object, and initializes it >with the value read from the stream. > That's correct, but note that it is not necessary to use pointer under Ada95. Data'Class'Output (Str, Object); (with Object whatever instance in the class heriachy). New_Object : constant Data'Class := Data'Class'Input (Str); Pascal. --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://ourworld.compuserve.com/homepages/pascal_obry --| --| "The best way to travel is by means of imagination"