comp.lang.ada
 help / color / mirror / Atom feed
From: Micronian Coder <micronian2@gmail.com>
Subject: Ada.Storage_IO. Anyone use it?
Date: Sat, 9 Jun 2012 01:18:05 -0700 (PDT)
Date: 2012-06-09T01:18:05-07:00	[thread overview]
Message-ID: <4cf48f9f-e028-4402-910a-cdd7e2b739cb@googlegroups.com> (raw)

Hi,

I was looking through the Ada RM and came across the generic package Ada.Storage_IO. I'm not sure what the benefits are to using it. It states that it could automatically flatten out the data representation if necessary. For example, say a discriminant record has an array field that is sized based on the discriminant value:

type Buffer(Length : Positive) is
    record
       Bytes: Byte_Array(1 .. Length);
    end record;

The implementation chosen by the compiler could have Bytes dynamically allocated rather than embedded (I believe Randy said the Janus/Ada compiler would always have the arrays of this type of record dynamically allocated). Using Ada.Storage_IO would store all the data into a buffer as if it was all together and when read back it could recreate the multi-part representation.

Did anyone find this package useful in practice rather than define their own IO routines (e.g. define stream operations to read and write their data)? I'm really curious.

Thanks!



             reply	other threads:[~2012-06-09  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-09  8:18 Micronian Coder [this message]
     [not found] <a09e06d1-716f-4e3b-926b-55144f20d35a@googlegroups.com>
2012-06-09  8:36 ` Ada.Storage_IO. Anyone use it? Dmitry A. Kazakov
2012-06-09 14:09   ` Georg Bauhaus
2012-06-09 14:24 ` anon
replies disabled

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