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,6eac62e4f2badf3a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-09 18:12:18 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Persistence of limited tagged types Date: 9 Apr 2003 18:12:18 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0304091712.65224f9@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1049937138 4565 127.0.0.1 (10 Apr 2003 01:12:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 10 Apr 2003 01:12:18 GMT Xref: archiver1.google.com comp.lang.ada:36038 Date: 2003-04-10T01:12:18+00:00 List-Id: Nick Roberts wrote in message news:... > > If you really intend to be serialising limited types, I suspect that (both > theoretically and practically) you need to have intermediate non-limited > types to help you. Serialisation of a limited type will then involve: > conversion to and from a suitable non-limited type; serialisation of the > non-limited type. All types ultimately comprise primitive scalar types (as integer, float, etc) and simple composite types (string, etc), so yes there will be non-limited types involved. What you'll probably have to do is "default construct" an instance, and then call read as a post-initialization step, e.g. function Input (Stream : access Root_Stream_Type'Class) return T_Class_Access is Key : constant String := String'Input (Stream); I : constant Iterator := Find (Map, Key); Factory : constant Factory_Type := Element (I); begin return Factory (Stream); end; The factory for T would look something like: function New_T (Stream : access Root_Stream_Type'Class) return T_Class_Access is O : constant T_Access := new T; --default value begin Read (Stream, O.all); --post-initialization return T_Class_Access (O); end;