From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b0f4738b8e27cca3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-25 10:03:06 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with protected type References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 25 Nov 2003 18:03:06 GMT NNTP-Posting-Host: 63.184.104.164 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1069783386 63.184.104.164 (Tue, 25 Nov 2003 10:03:06 PST) NNTP-Posting-Date: Tue, 25 Nov 2003 10:03:06 PST Xref: archiver1.google.com comp.lang.ada:2929 Date: 2003-11-25T18:03:06+00:00 List-Id: Ekkehard Morgenstern wrote: > type CoreEvent is limited private; > > protected BaseEvent is > entry Wait; > procedure Signal; > procedure ManualMode; > procedure AutoMode; > procedure Reset; > function IsSignaled return Boolean; > private > EventObject : CoreEvent; > ManualReset : Boolean := FALSE; > end BaseEvent; > > The compiler reports "premature usage of incomplete type derived from > "BaseEvent"". That's not a great error message. 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. 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. > 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. 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. -- Jeff Carter "Sheriff murdered, crops burned, stores looted, people stampeded, and cattle raped." Blazing Saddles 35