comp.lang.ada
 help / color / mirror / Atom feed
From: Ray Blaak <blaak@infomatch.com>
Subject: Re: Generic Instances Scope control  ???
Date: 2000/02/22
Date: 2000-02-22T00:00:00+00:00	[thread overview]
Message-ID: <m31z64y1hh.fsf@ns52.infomatch.bc.ca> (raw)
In-Reply-To: sb507779r2a96@corp.supernews.com

"Vladimir Olensky" <vladimir_olensky@yahoo.com> writes:
> procedure tst_Gen is
> 
>    c1 :  Controller_Type;
>    procedure c1_stat is new GStat (Controller => c1);
>     --> want to hide c1_stat from client
[...]
> begin
> 
>    Register_Callback (c1, c1_stat'Unrestricted_Access);
>     -->  want to hide Register_Callback  from client
[...]

Just do the instantiation and registeration in another package; no scope
operator is needed:

  with G; use G;
  generic
      Controller : in out Controller_Type;
  package Register_GStat is
  end Register_GStat

  package body Register_GStat is
      procedure Stat is new GStat (Controller => Controller);
  begin
      Register_Callback (Controller, Stat'Unrestricted_Access);
  end Register_GStat;

and then:

 procedure tst_Gen is
    c1 :  Controller_Type;
    package c1_stat is new Register_GStat (Controller => c1);
 begin
    -- Register_Callback is already called by this point.
    ...
 end test_Gen;

-- 
Cheers,                                        The Rhythm is around me,
                                               The Rhythm has control.
Ray Blaak                                      The Rhythm is inside me,
blaak@infomatch.com                            The Rhythm has my soul.




  reply	other threads:[~2000-02-22  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-22  0:00 Generic Instances Scope control ??? Vladimir Olensky
2000-02-22  0:00 ` Ray Blaak [this message]
2000-02-23  0:00   ` Vladimir Olensky
2000-02-23  0:00     ` Ray Blaak
replies disabled

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