comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Storage_IO. Anyone use it?
@ 2012-06-09  8:18 Micronian Coder
  0 siblings, 0 replies; 4+ messages in thread
From: Micronian Coder @ 2012-06-09  8:18 UTC (permalink / 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!



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-09 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
2012-06-09  8:18 Micronian Coder

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