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: "Marc A. Criley" Subject: Re: Overlay allowability Date: 2000/05/10 Message-ID: <39198FC4.62382ECE@lmco.com>#1/1 X-Deja-AN: 621629400 Content-Transfer-Encoding: 7bit References: <390D94FB.D23390D4@lmco.com> <8eketr$i3c$1@nnrp1.deja.com> <3910514D.13BF2DE1@Raytheon.com> <8es7n2$7lk$1@nnrp1.deja.com> <3916D7F4.178B4FDE@Raytheon.com> <8f744h$s38$1@nnrp1.deja.com> <39184D91.13BA15B4@Raytheon.com> <8f9npd$pep$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.vf.lmco.com X-Trace: knight.vf.lmco.com 957975698 18680 166.17.131.243 (10 May 2000 16:21:38 GMT) Organization: Lockheed Martin M&DS Mime-Version: 1.0 NNTP-Posting-Date: 10 May 2000 16:21:38 GMT Newsgroups: comp.lang.ada Date: 2000-05-10T16:21:38+00:00 List-Id: Okay, if there's a simple answer to this I'm going to look really dumb for asking...but I'll take that chance :-) 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. I've been all over the RM95 looking for a nice, clean way to do this, and have not been able to find one. It appears then to come down to working with Unchecked_Conversion or the 'Address overlay approach (the latter of which was provided as the example in my original posting). If there's a straightforward way to accomplish what I'm _really_ trying to do, I would very much like to hear it! And performance does matter, since I want to minimize socket blocking. Oh, and to forestall the "Why not use the DSA?" question, the answer is that the required post-processing associated with GLADE just won't fly with clients, so I need to use the basic client/server model. Marc A. Criley Ted Dennison wrote: > > In article <39184D91.13BA15B4@Raytheon.com>, > "Samuel T. Harris" wrote: > > > problems across compiler implementations. It is rare that > > such interfacing code deals with unconstrainted arrays > > or polymorphic variant records. Usually just run-of-the-mill > > scalars, static records, and constrainted arrays. > > The typical use I've seen of it (UC-ing addresses into object pointers) > is in converting random data objects into arays of bytes. Since the base > type for one side is typically an unconstrained array of bytes, I think > this is quite likely to be an issue. > > Usually this is done to convert some nice user data structure into > something an entity outside of Ada (such as an OS call) can deal with. > Just about any other use is going to be a hack around a badly-chosen > type. Thus the Right Thing would be to redesign the type. > > -- > T.E.D. > > http://www.telepath.com/~dennison/Ted/TED.html > > Sent via Deja.com http://www.deja.com/ > Before you buy.