comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Protected types and visibility of their internals
Date: Wed, 09 Jul 2008 18:19:04 -0400
Date: 2008-07-09T18:19:04-04:00	[thread overview]
Message-ID: <uvdzed7l3.fsf@nasa.gov> (raw)
In-Reply-To: b1f2203b-ed02-4031-bcba-40c0e1b1be07@j22g2000hsf.googlegroups.com

Maciej Sobczak <see.my.homepage@gmail.com> writes:

> Consider a protected type in some package:
>
> package P is
>    protected type PT is
>       procedure Foo;
>    private
>       X : Some_Type;
>    end PT;
> end P;
>
> The protected type has a component X of Some_Type, which is entirely
> the private business of the protected type.
>
> Where this type should be declared?

In a sibling private package:

private
package P.stuff is

    type Some_Type is ...;
end P.Stuff;

private with P.stuff;
package P is
   protected type PT is
      procedure Foo;
   private
      X : P.Stuff.Some_Type;
   end PT;
end P;

Hmm. Maybe that's not right, since P.Stuff is used in the private part
of a public type, not strictly in the private part of P. But it
_should_ be ok!

-- 
-- Stephe



  parent reply	other threads:[~2008-07-09 22:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08  9:57 Protected types and visibility of their internals Maciej Sobczak
2008-07-08 12:52 ` Georg Bauhaus
2008-07-08 16:13 ` Robert A Duff
2008-07-09  7:53   ` christoph.grein
2008-07-08 21:03 ` Randy Brukardt
2008-07-10 21:49   ` Maciej Sobczak
2008-07-09  5:04 ` christoph.grein
2008-07-09 13:44   ` Maciej Sobczak
2008-07-09 15:12   ` Adam Beneschan
2008-07-09 22:19 ` Stephen Leake [this message]
2008-07-09 22:38   ` Adam Beneschan
2008-07-10  0:18     ` Randy Brukardt
2008-07-10  0:18     ` Randy Brukardt
2008-07-09 23:22 ` jimmaureenrogers
replies disabled

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