comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lundquist <mark@rational.com>
Subject: Re: entry references
Date: 1999/09/14
Date: 1999-09-14T00:00:00+00:00	[thread overview]
Message-ID: <37DEAD47.B46E5457@rational.com> (raw)
In-Reply-To: 37DE6FC9.51FD00CE@york.ac.uk

Ian Thomson wrote:

> Does anyone know how I can reference a protected entry?
>
> I am trying to write a generic package that will operate
> as an indirection to protected entries- and I can find no
> way of referncing the entry.
>



> I tried renaming the entry as a procedure, then passing
> this as a generic parameter, but you then get procedure-
> like blocking, which defeats the object.
>

I'm not sure what you mean by "procedure-like blocking".  What is true
is that when you rename the entry you lose its "entry-ness", so for
instance you cannot call it in places where an entry call is required,
like an asynchronous select, conditional entry call, etc.

> You also cannot declare access to subprogram types for
> entries.
>

Right, because they are not subprograms.

> any ideas? thanks,
>

It sounds like you are wishing there were such a thing as a "generic
formal entry" parameter.  Is that the idea?

Without knowing exactly what you're up to, it's hard to say (for
instance, what kind of genericity are you trying to achieve?)  One
suggestion is that your protected type can have a discriminant, and that
discriminant can be an access discriminant, and in particular it can be
a classwide access discriminant.  This allows your protected type in
effect to serve as the root of a type hierarchy, even though protected
types themselves can't be extended.  If this ends up solving your
problem, it may turn out that your package doesn't even have to be
generic after all -- as I said before, it's hard to know without more
detail...


--

Mark Lundquist
Senior Software Engineer
Rational Software
Development Solutions Business Unit
UNIX Suites Group
Aloha, OR, USA






  reply	other threads:[~1999-09-14  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-14  0:00 entry references Ian Thomson
1999-09-14  0:00 ` Mark Lundquist [this message]
1999-09-14  0:00 ` Matthew Heaney
replies disabled

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