comp.lang.ada
 help / color / mirror / Atom feed
From: Steve Quinlan <steven.quinlan@nospam.lmco.com>
Subject: Re: Ada.Streams examples
Date: 1999/03/10
Date: 1999-03-10T00:00:00+00:00	[thread overview]
Message-ID: <36E68CF9.6E48A77B@nospam.lmco.com> (raw)
In-Reply-To: 36e61db4.50430543@news.pacbell.net

Tom Moran wrote:

> Could someone please point me to a text or tutorial or something on
> using Ada.Streams - in particular overriding the default 'Read etc.

If you're asking the mechanics of how to accomplish the override (vs.
how to implement it), the general concept is you define a subprogram
something like this for type foo;

procedure Foo_Write ( Stream access Root_Stream_Type'class;
                                  Item in Foo) is
--- code here
end Foo_Write;
for Foo'Write use Foo_Write;

As far as what to put into Foo_Write, you can do whatever you like --
implement it using the stream attributes of components of Foo,
re-ordering them or adding things or whatever. You could also define
your own way to convert Foo into an array of Stream Elements, and update
the Stream using the overriden Write procedure from Ada.Streams, which
given an array of stream elements will write it to the stream  (and
similarly for reading Foo).

There is a limited example of this in the  Barnes book 'Programming in
Ada95'.







      parent reply	other threads:[~1999-03-10  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 ` 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
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
1999-03-10  0:00 ` Steve Quinlan [this message]
replies disabled

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