comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Ada.Storage_IO: applied example?
Date: Wed, 24 Oct 2012 02:49:02 -0700 (PDT)
Date: 2012-10-24T02:49:02-07:00	[thread overview]
Message-ID: <ca5e1dba-d5d4-4f7c-b0c0-2270f683b86a@googlegroups.com> (raw)
In-Reply-To: <ojrfstwtiak6.oeklfsnvcr1k$.dlg@40tude.net>

See AARM A.9(1.a):
Reason: This package exists to allow the portable construction of user-defined direct-access-oriented input-output packages. The Write procedure writes a value of type Element_Type into a Storage_Array of size Buffer_Size, flattening out any implicit levels of indirection used in the representation of the type. The Read procedure reads a value of type Element_Type from the buffer, reconstructing any implicit levels of indirection used in the representation of the type. It also properly initializes any type tags that appear within the value, presuming that the buffer was written by a different program and that tag values for the “same” type might vary from one executable to another.

On Wednesday, October 24, 2012 9:34:32 AM UTC+2, Dmitry A. Kazakov wrote:
> data at. Furthermore the generic parameter should have been declared as:
>    type Element_Type (<>) is private.

See A.9(10.a):
Reason: As with Direct_IO, the Element_Type formal of Storage_IO does not have an unknown_discriminant_part so that there is a well-defined upper bound on the size of the buffer needed to hold the content of an object of the formal subtype (i.e. Buffer_Size). If there are no implicit levels of indirection, Buffer_Size will typically equal:
   (Element_Type'Size + System.Storage_Unit - 1) / System.Storage_Unit



  reply	other threads:[~2012-10-24  9:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 19:42 Ada.Storage_IO: applied example? Yannick Duchêne (Hibou57)
2012-10-23 20:28 ` Dmitry A. Kazakov
2012-10-23 20:56   ` Yannick Duchêne (Hibou57)
2012-10-23 21:21     ` Adam Beneschan
2012-10-23 21:02   ` Jeffrey Carter
2012-10-24  7:20     ` Dmitry A. Kazakov
2012-10-24  5:03   ` J-P. Rosen
2012-10-24  7:34     ` Dmitry A. Kazakov
2012-10-24  9:49       ` AdaMagica [this message]
2012-10-24 10:28         ` Dmitry A. Kazakov
2012-10-24 11:51           ` Yannick Duchêne (Hibou57)
2012-10-24 12:27             ` Dmitry A. Kazakov
2012-10-24 14:03             ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox