comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Protected types made of ADT's, and Passive Iterators
Date: 1998/09/07
Date: 1998-09-07T00:00:00+00:00	[thread overview]
Message-ID: <35F3FBE2.5C08F967@elca-matrix.ch> (raw)
In-Reply-To: udpvdbl8uf.fsf@tanana.llnl.gov

John Woodruff wrote:

> I can make a generic package that encapsulates a protected instance of
> List in a fairly straightforward way:

> BUT the base list ADT provided a passive iterator, and I'd like to offer
> that capability to the clients of my protected ADT as well.

This comes from Ada 95's failure to recognize generics as operations of a
type. You cannot declare generic task entries or generic protected operations.

The only way around the problem is to have a semaphore protecting the data in
your list, but there is no easy way of encapsulating your data into a task
safe construct (task or protected type).

I have discussed this issue in detail in my thesis
<http://lglwww.epfl.ch/Team/MW/Ada-Extensions/Ada-Extensions.html>.

I have some code doing what you want (implement an ADT and its protected form
with the same specification) for AVL trees. Mail me if you are interested.




      parent reply	other threads:[~1998-09-07  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-04  0:00 Protected types made of ADT's, and Passive Iterators John Woodruff
1998-09-05  0:00 ` Tom Moran
1998-09-05  0:00 ` Matthew Heaney
1998-09-05  0:00   ` Tom Moran
1998-09-07  0:00   ` Mats Weber
1998-09-17  0:00     ` Matthew Heaney
1998-09-07  0:00 ` Mats Weber [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