comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Ada streams
Date: Wed, 15 Dec 2004 13:35:51 -0600
Date: 2004-12-15T13:35:51-06:00	[thread overview]
Message-ID: <m_GdnST9f8-KD13cRVn-gg@comcast.com> (raw)
In-Reply-To: 32baduF3gtbllU1@individual.net

>Maybe I should say a quick word on what a stream is. In practice, a
>stream is a sequence of bytes -- which are called 'octets' formally --
>which comprise the binary representation of one or a sequence of
>variable values. The values can be of any type. The bytes do not
  Ada.Streams gives a standardized way for the designer of an object
to supply "IO" routines for that object.  Thus Bitmap'Write might in
fact create a JPEG compressed version of an in-memory bitmap array.
If a user creates a composite object he automatically gets an IO
routine that will make the necessary calls for the component parts.
Thus given
  type Stereo_Image_Type is record
    Left, Right : Bitmap;
  end record;
Stereo_Image_Type'Write(F,Scene); will automatically call Bitmap'Write
on the Left and Right images (unless overridden, of course).
  Ada.Streams does not require you to use Ada.Streams.Stream_IO, however,
so you can also create specialized children of Root_Stream_Type which
don't do IO, but rather something else.  You might just want the
Stream_Element_Count of the size of the object, or perhaps a checksum of
its Stream_Element_Array representation.



  reply	other threads:[~2004-12-15 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-15  7:43 Ada streams Daniel Vencler
2004-12-15 13:41 ` John B. Matthews
2004-12-15 17:26 ` Nick Roberts
2004-12-15 19:35   ` tmoran [this message]
2004-12-15 19:26 ` David C. Hoos
replies disabled

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