From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:620a:221:: with SMTP id u1mr12582651qkm.373.1600080427304; Mon, 14 Sep 2020 03:47:07 -0700 (PDT) X-Received: by 2002:a37:381:: with SMTP id 123mr12076776qkd.320.1600080426930; Mon, 14 Sep 2020 03:47:06 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 14 Sep 2020 03:47:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=92.56.166.72; posting-account=C8J7NQoAAAD_ybGY7--QIRi6KpLjoH1Z NNTP-Posting-Host: 92.56.166.72 References: <6096c490-7112-415e-978b-fd4c78f28501n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Visibility issue From: Daniel Injection-Date: Mon, 14 Sep 2020 10:47:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:60136 List-Id: > hierarchy be a child hierarchy of your interface hierarchy. It's undoubte= dly=20 > possible to design such a system so your implementation hierarchy does no= t need=20 > to be a child hierarchy, but where things are declared and what is visibl= e where=20 > would be different. Thank you for your answer. =C2=BF Do you know some idea or design pattern t= o achieve this? I didn't write it in the example for simplicity, but the user have to set a= callback function. This callback function is triggered in the internal implementation hierarch= y packages. Let me show you. the questions are inside comments: --- API SIDE: ----- package API.Callbacks type Handle is tagged private type pointer_to_Procedure is access procedure (Self : API.CAllbacks.Hand= le ); procedure Set_Callback (Self: in out API_HandleCallBack; cp: CallbackPro= cedure ); private =20 type Handle is tagged record Hidden : Natural; end record; procedure Hidden_constructor (S: in out Handle'Class ; Hidden_content :Na= tural); --------------- ----- IMPLEMENTING SIDE: -------- with API.Callbacks; package body Internal.TASKS_Callbacks is task body Caller is MyHandle : API.Handle; cp: CallbackProcedure :=3D Get_from_pool_of_callbacks; begin --Cannot access to private part for API.Handle from here :( -- Just want to set a hidden content from here using Hidden_Constructor = and later call: cp (MyHandle); end Caller;