comp.lang.ada
 help / color / mirror / Atom feed
From: "Ekkehard Morgenstern" <ekkehard.morgenstern@onlinehome.de>
Subject: Re: Problem with protected type
Date: Tue, 25 Nov 2003 19:31:38 +0100
Date: 2003-11-25T19:31:38+01:00	[thread overview]
Message-ID: <bq0766$154$1@online.de> (raw)
In-Reply-To: uPMwb.14566$n56.8738@newsread1.news.pas.earthlink.net


"Jeffrey Carter" <spam@spam.com> schrieb im Newsbeitrag
news:uPMwb.14566$n56.8738@newsread1.news.pas.earthlink.net...
> > The compiler reports "premature usage of incomplete type derived from
> > "BaseEvent"".
>
> That's not a great error message.

That's true, because CoreEvent is not derived from BaseEvent. I already
figured it had to do with the CoreEvent component instantiation, but the
message is strange indeed.

> I suspect that your real problem is that you omitted the word "type"
> between "protected" and "Baseevent". "protected Baseevent" declares a
> single protected object; "protected type Baseevent" declares a type
> which may then be used to declare many objects of the type.

Thank you! I completely overlooked that! ;-)

> A type declaration may include a reference to an incomplete type, such
> as Coreevent. An object declaration may not, since it has to allocate
> space for the components, and the compiler does not yet know how much
> space needs to be allocated for Coreevent.

Ok. It's clear to me now! :-)

I thought I was creating a type, not a object. But of course it seems
logical that "type" would be required to designate a type. ;-)

> > Can I use a barrier expression that is doing a function call?
>
> Yes, a barrier can be any boolean expression. If you limit yourself to
> the Ravenscar profile, however, a barrier must be a Boolean component of
> the object.

What is the Ravenscar profile?  And why would a barrier be limited to a
Boolean component then?

> BTW, I find the Ada way, Base_Event, much easier to read than Baseevent,
> which is what my reformatter does with your kind of identifiers.

Ok. I can change it, I always fear I clash with predefined names, and
thought the contracted version would be less a candidate for that.

But as far as I understand, the default namespace includes only the Standard
package, right?

BTW, are there any predefined Lists, Queues, Events, Message Queues, and
Containers I could use? I didn't find anything in the Ada 95 reference.






  reply	other threads:[~2003-11-25 18:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25 15:15 Problem with protected type Ekkehard Morgenstern
2003-11-25 15:43 ` Ekkehard Morgenstern
2003-11-25 16:06   ` Robert I. Eachus
2003-11-25 18:39     ` Ekkehard Morgenstern
2003-11-26 15:43       ` Robert I. Eachus
2003-11-25 16:45   ` Ludovic Brenta
2003-11-25 18:45     ` Ekkehard Morgenstern
2003-11-25 20:09     ` Randy Brukardt
2003-11-25 18:03 ` Jeffrey Carter
2003-11-25 18:31   ` Ekkehard Morgenstern [this message]
2003-11-26  0:42     ` Jeffrey Carter
replies disabled

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