comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Mixing public and private member of a class. Dealing with what to hide and not
Date: Wed, 13 Feb 2019 21:39:22 +0100
Date: 2019-02-13T21:39:22+01:00	[thread overview]
Message-ID: <q41v9q$3j7$1@dont-email.me> (raw)
In-Reply-To: <5e42642d-3dd4-4c53-8b24-50bde70485f8@googlegroups.com>

Le 13/02/2019 à 18:40, Daniel Norber a écrit :
> I'm having big troubles in how Ada deals mixing public and private member of a class. 
> 
I'm not sure if this is really your problem, but since you are new to
Ada, let me explain this.

In Ada, the fundamental building block is the type. Every property is
attached to a type. Unlike C++, being public or private is not a
property of a member, but a property of the member's type. Hence you can do:

package Pack is
    type Secret_Data is private;
    type Instance is tagged
       record
          My_Public: Some_Public_Type;
          My_Secret: Secret_Data;
       end record;
    ...

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

  parent reply	other threads:[~2019-02-13 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 17:40 Mixing public and private member of a class. Dealing with what to hide and not Daniel Norber
2019-02-13 17:46 ` Daniel
2019-02-13 20:05 ` Dmitry A. Kazakov
2019-02-13 20:39 ` J-P. Rosen [this message]
2019-02-14  0:21 ` Jere
2019-02-14 18:04 ` G.B.
2019-02-22  8:42 ` Daniel
replies disabled

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