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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec1cbb3f01d2cff2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!uucp.gnuu.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Direct_IO and files of tagged types Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1117128009.277967.14010@g14g2000cwa.googlegroups.com> Date: Thu, 26 May 2005 20:22:38 +0200 Message-ID: <86bcmsy3e49m.yjhfcxtf7osr.dlg@40tude.net> NNTP-Posting-Date: 26 May 2005 20:22:42 MEST NNTP-Posting-Host: 484f2337.newsread4.arcor-online.net X-Trace: DXC=322S;@aFZaPYFAnNd=0_4T:ejgIfPPldTjW\KbG]kaMXZmYl>WOG@=UI^>26:moI[Y[6LHn;2LCV^COgUkn_?_Y_>9f]>UeIVDZ X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:11167 Date: 2005-05-26T20:22:42+02:00 List-Id: On 26 May 2005 10:20:09 -0700, John McCormick wrote: > When I instantiate a version of Ada.Direct_IO with an element type that > is statically tagged (it is of a specific tagged type) GNAT gives me a > warning that the element type contains an access value. My tagged type > has three integer fields - no access types. I assume that the access > type referenced in the warning is to the tag mechanism. Any suggestions > for ways to create binary files of statically tagged objects? It is not a good idea to write tags into a file even if they are statically known, because that cannot be portable. Another general question is: if the tag is always known what for to have it? Without dispatching tags are just useless overhead! Anyway what about: 1. Aggregation: you put a plain record into tagged type and do I/O with that record. 2. A completely independent record type used for external representation of tagged objects. 3. Handles/smart pointers: tagged objects refer to a plain record type via an access discriminant or an access type. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de