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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ab36006a122bb868 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Overlay allowability Date: 2000/05/12 Message-ID: #1/1 X-Deja-AN: 622661351 References: X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 958157359 206.170.2.84 (Fri, 12 May 2000 11:49:19 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Fri, 12 May 2000 11:49:19 PDT Newsgroups: comp.lang.ada Date: 2000-05-12T00:00:00+00:00 List-Id: > My goal has been to serialize an arbitrary object (the type of which is > provided as a generic formal parameter) into a Stream_Element_Array for > use with the AdaSockets package. In Claw, we have: type Socket_Stream_Type(Socket : access Socket_Type'class) is new Ada.Streams.Root_Stream_Type with record ... procedure Write(Stream : in out Socket_Stream_Type; Item : in Ada.Streams.Stream_Element_Array); So you can declare an aliased object X of type Socket_Stream_Type. To open, close, etc, you make calls to Open(X.Socket), etc. Once the socket is open, "Data_Type'Write(X'access, Data);" will generate calls to Write(X.Socket, Data Components) as needed for the components of Data.