comp.lang.ada
 help / color / mirror / Atom feed
From: Daniel <danielnorberto@gmail.com>
Subject: Re: Visibility issue
Date: Mon, 14 Sep 2020 03:47:06 -0700 (PDT)	[thread overview]
Message-ID: <f7bd4bbf-1138-4361-8d4f-bfbcfe2f76f7n@googlegroups.com> (raw)
In-Reply-To: <rjgu4s$fld$1@dont-email.me>


> hierarchy be a child hierarchy of your interface hierarchy. It's undoubtedly 
> possible to design such a system so your implementation hierarchy does not need 
> to be a child hierarchy, but where things are declared and what is visible where 
> would be different.
Thank you for your answer. ¿ Do you know some idea or design pattern to 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 hierarchy 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.Handle );
   procedure Set_Callback (Self: in out API_HandleCallBack; cp: CallbackProcedure  );

private   
   type Handle is tagged record
      Hidden : Natural;
   end record;
  procedure Hidden_constructor (S: in out Handle'Class ; Hidden_content :Natural);
---------------
----- IMPLEMENTING SIDE: --------
with API.Callbacks;
package body Internal.TASKS_Callbacks is

task body Caller is

 MyHandle : API.Handle;
 cp: CallbackProcedure := 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;

  reply	other threads:[~2020-09-14 10:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 10:37 Visibility issue Daniel
2020-09-11 11:51 ` Maxim Reznik
2020-09-11 20:11   ` Daniel
2020-09-11 14:23 ` Jeffrey R. Carter
2020-09-11 20:17   ` Daniel
2020-09-11 22:36     ` Jeffrey R. Carter
2020-09-14 10:47       ` Daniel [this message]
2020-09-14 16:10         ` Jeffrey R. Carter
2020-09-15 19:11           ` Daniel
2020-09-15 20:03             ` Jeffrey R. Carter
2020-09-11 21:05 ` Dmitry A. Kazakov
2020-09-14 11:33   ` Daniel
2020-09-14 14:42     ` Dmitry A. Kazakov
2020-09-15 19:35       ` Daniel
2020-09-16  7:14         ` Dmitry A. Kazakov
2020-09-16 10:23           ` Daniel
2020-09-16 10:58             ` Dmitry A. Kazakov
2020-09-16 14:35               ` Daniel
2020-09-16 14:49                 ` Jeffrey R. Carter
2020-09-16 15:05                 ` Dmitry A. Kazakov
2020-09-16 20:09                   ` Daniel
2020-09-16 21:48                     ` Simon Wright
2020-09-17 13:31                       ` Daniel
2020-09-17 15:00                         ` Dmitry A. Kazakov
2020-09-17 15:32                           ` Daniel
2020-09-17 16:47                             ` Dmitry A. Kazakov
2020-09-18  8:05                         ` Simon Wright
2020-09-14 16:18 ` Simon Wright
2020-09-17 15:58 ` Jere
2020-09-17 16:10 ` Jere
2020-09-18  8:08   ` Simon Wright
2020-09-17 21:47 ` Shark8
replies disabled

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