comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Ada.Streams examples
Date: 1999/03/11
Date: 1999-03-11T00:00:00+00:00	[thread overview]
Message-ID: <7c8o0u$509$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 36e6fe8d.16020474@news.pacbell.net

In article <36e6fe8d.16020474@news.pacbell.net>,
  tmoran@bix.com (Tom Moran) wrote:
> >  o  Create a 'Write procedure for that bitmap type which converts the bitmap
> >to a bmp and does one massive Write call for the stream. The problem with
> >this approach is that if anyone ever wants to do a 'Write on a bitmap for any
> >reason, the'll get a BMP. You can't overload it to get a JPG or GIF or a
> >straight memory dump (which is what they might be expecting).
>   Someone could presumably do
>      type GIFED_Bitmap is new BMP with null record;
>      for GIFED_Bitmap'Write use  Convert_To_GIF_And_Write;
> Then internally a GIFED_Bitmap is the same as my BMP, and my routines
> all work on it, but when the user writes it he gets his
> Convert_To_GIF_And_Write instead of my BMP'Write.
> No?

Well, yes. But those are still different types, not the same type. I can think
of several other objections, but they all really boil down to...YUK!

> >  o  Create a Write_BMP and Read_BMP routine that take in files and bitmaps
as
> >parameters, and forget about streams.
>   But with the BMP'Write I separate the file from the conversion, so
> the result of the conversion could be handed to a called C routine,
> say.  That seems to me a pretty strong argument for BMP'Write instead
> of BMP_Write.

That is true. If there are several different sources you might want to route
your output to other than just disk files, that is a point in the favor of
using 'Write for the conversion. But note that in the case you give the C
routine will have to be able to handle the data in the way 'Write will give
it. If you write both 'Write and the stream's Write (which internally
interfaces to the C) then you should be ok. You still have the problem of
some goober comming along and trying to do an Integer'Write to your BMP
stream, but perhaps that's not a big deal in your application.



T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-03-11  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-10  0:00 Ada.Streams examples Tom Moran
1999-03-10  0:00 ` Steve Quinlan
1999-03-10  0:00 ` dennison
1999-03-10  0:00   ` Tom Moran
1999-03-10  0:00     ` dennison
1999-03-10  0:00       ` Tom Moran
1999-03-11  0:00         ` dennison [this message]
1999-03-17  0:00           ` Tom Moran
1999-03-11  0:00     ` Richard D Riehle
1999-03-11  0:00       ` Steve Quinlan
1999-03-11  0:00         ` Richard D Riehle
1999-03-11  0:00           ` Steve Quinlan
1999-03-12  0:00             ` Richard D Riehle
1999-03-10  0:00   ` Rex Reges
1999-03-10  0:00     ` dennison
     [not found]       ` <36E7036B.EADEEA80@Boeing.com>
1999-03-11  0:00         ` dennison
replies disabled

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