comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.invalid>
Subject: Re: Instantiating package problems
Date: Sun, 10 Jan 2016 22:50:13 +0100
Date: 2016-01-10T22:50:13+01:00	[thread overview]
Message-ID: <n6ujhk$otp$1@dont-email.me> (raw)
In-Reply-To: <6583d5e1-2d8b-4c90-bb9d-9673061e76c7@googlegroups.com>

On 10.01.16 20:43, Andrew Shvets wrote:
>
>   When you instantiate a record (which is described in the private portion of a package), does that mean that the insides (the different types, lists, arrays, etc.) that compose it are not visible to others except through setter and getter methods?
>

when a type is declared as a private type in some page P,

package P is

    type T ... is ... private;

then, outside the package, only public operations are visible,
basically anything that follows the declaration until another
"private" introduces the private part of P. Hence, no data
components of any object of type P.T declared outside.

Suppose

package P is
    type T is private;
    procedure op1 (Object : in out T);
private
   type T is record
      c1 : T1 := Foo(N);
      c2 : T2;
   end record;
end P;

then I think it is fair to say this C++ type is an analogue,
perhaps declared in a file "p.hpp", or in namespace P:

struct T {
private:
   T1 c1;
   T2 c2;
public:
   T() : c1(foo(n))
    {
   }
   void op1(void);
};



  parent reply	other threads:[~2016-01-10 21:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 18:40 Instantiating package problems Andrew Shvets
2016-01-03 20:27 ` Georg Bauhaus
2016-01-03 21:21   ` Andrew Shvets
2016-01-03 21:04 ` Jeffrey R. Carter
2016-01-03 21:27   ` Andrew Shvets
2016-01-03 22:39     ` Jeffrey R. Carter
2016-01-03 22:08 ` Bob Duff
2016-01-04  0:07   ` Andrew Shvets
2016-01-04  0:30     ` Andrew Shvets
2016-01-04 13:43       ` G.B.
2016-01-04 14:23       ` Brian Drummond
2016-01-04 20:49     ` Anh Vo
2016-01-04 21:10       ` Dmitry A. Kazakov
2016-01-04 22:39         ` Anh Vo
2016-01-05  1:42           ` Anh Vo
2016-01-05  7:35           ` Dmitry A. Kazakov
2016-01-06  2:46       ` Andrew Shvets
2016-01-06  8:53         ` Dmitry A. Kazakov
2016-01-06  3:30       ` Andrew Shvets
2016-01-06  4:51         ` Anh Vo
2016-01-06  4:54           ` Anh Vo
2016-01-06  5:00           ` Andrew Shvets
2016-01-06  5:07             ` Anh Vo
2016-01-07  4:41               ` Andrew Shvets
2016-01-07  5:41                 ` Anh Vo
2016-01-09 20:14                   ` Andrew Shvets
2016-01-10 19:43                     ` Andrew Shvets
2016-01-10 21:38                       ` Jeffrey R. Carter
2016-01-10 21:50                       ` Georg Bauhaus [this message]
2016-01-10 21:58                         ` Andrew Shvets
2016-01-06 13:07             ` G.B.
2016-01-07  4:42               ` Andrew Shvets
2016-01-06 14:25           ` Bob Duff
2016-01-06 23:48             ` Anh Vo
replies disabled

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