comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Streams and Concurrency
Date: 1999/01/04
Date: 1999-01-04T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.99Jan4145726@spectre.mitre.org> (raw)
In-Reply-To: 76e4rg$bsr$1@nnrp1.dejanews.com

In article <76e4rg$bsr$1@nnrp1.dejanews.com> dennison@telepath.com writes:

 > But this solution only works for objects that are part of the same class
 > hiearchy. That's too restrictive. I'd want to be able to use any type. It
 > sounds like Tuck's generic suggestion is the way to go.

   Wonderful opertunity for generic children. ;-)  Create a (generic)
package that encapsulates the stream and the locking mechanism.  This
package would then have a generic child package that you instantiate
once for each type you want to write to the stream.  (And now for the
really tricky part...)

   If you want to be able to read the mixed stream without knowing
what type of value appears next, you have to have a parent type in the
parent generic, or a parent access type, and a read operation declared
there which returns objects of the class rooted at this type.  You can
then use a fairly common Ada idiom (a declare block with a class-wide
object initialized by a function) to make the contents of the stream
available.

   The case where you know the structure of the stream, or as Tucker
suggested, have markers in the stream, is much easier to program.

      
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  parent reply	other threads:[~1999-01-04  0:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-30  0:00 Streams and Concurrency James S. Rogers
1998-12-29  0:00 ` David Botton
1998-12-30  0:00   ` James S. Rogers
1998-12-30  0:00     ` dennison
1998-12-30  0:00       ` James S. Rogers
1999-01-04  0:00       ` Robert I. Eachus [this message]
1998-12-31  0:00     ` Jean-Pierre Rosen
1998-12-31  0:00       ` dewar
1998-12-31  0:00         ` Ada-G, was " Tom Moran
1999-01-01  0:00           ` dewar
1999-01-01  0:00             ` Larry Kilgallen
1999-01-01  0:00           ` Brian Rogoff
1999-01-04  0:00             ` Robert I. Eachus
1999-01-08  0:00               ` Mats Weber
1999-01-08  0:00                 ` Robert I. Eachus
1999-01-08  0:00         ` Mats Weber
1999-01-08  0:00           ` Tucker Taft
1998-12-31  0:00       ` dewar
1998-12-31  0:00         ` dennison
1999-01-04  0:00         ` Jean-Pierre Rosen
1999-01-04  0:00           ` robert_dewar
1998-12-30  0:00   ` dennison
1998-12-30  0:00     ` Tucker Taft
1998-12-30  0:00       ` Robert I. Eachus
1998-12-30  0:00         ` Tucker Taft
1998-12-31  0:00         ` dennison
1998-12-31  0:00           ` robert_dewar
1998-12-31  0:00             ` dennison
1999-01-01  0:00               ` robert_dewar
1999-01-04  0:00           ` Robert I. Eachus
1998-12-30  0:00       ` dennison
1998-12-31  0:00         ` robert_dewar
1998-12-30  0:00 ` dennison
1998-12-30  0:00   ` Robert I. Eachus
1999-01-11  0:00   ` Bulk synchronous model for IO (was Re: Streams and Concurrency) Kevin Rigotti
replies disabled

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