comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Logical constants
Date: Mon, 2 Oct 2017 21:26:57 +0200
Date: 2017-10-02T21:26:57+02:00	[thread overview]
Message-ID: <oqu3u3$t9d$1@gioia.aioe.org> (raw)
In-Reply-To: oqu2ot$r3v$1@gioia.aioe.org

On 2017-10-02 21:07, Victor Porton wrote:

> What should be argument mode for an object for which a handler (of some kind
> of event or some callback) is set?
> 
> Set_Handler_*(Object, ...);
> 
> Currently I am thinking about
> 
> procedure Set_BNode_ID_Handler
>    (World: Raptor_World_Type_Without_Finalize'Class;
>     Handler: access BNode_ID_Handler'Class);
> 
> World is a main object of a library, to keep there user settings.
> 
> Handler is a generator of a blank node ID (that is a unique string starting
> from underscore, like "_ax123").
> 
> Should Set_BNode_ID_Handler be considered as modifying World object?

Likely so.

One of two arguments should be dispatching. If handler is a proxy object 
it should be passed without access and copied inside. If handler is not 
a proxy then it should be "not null access", unless null value is used 
to remove the handler.

Now if all handlers are siblings then it goes as:

    type Abstract_Handler is ... abstract ...;
    procedure Set
              (  Handler : not null access Abstract_Handler;
                 World   : in out ...'Class
              )  is abstract;

    type BNode_Handler is new Abstract_Handler with ...;
    overriding
       procedure Set
                 (  Handler : not null access BNode_Handler;
                    World   : in out ...'Class
                 );

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


      reply	other threads:[~2017-10-02 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 18:12 Logical constants Victor Porton
2017-09-29 20:50 ` Dmitry A. Kazakov
2017-10-02 19:07   ` Victor Porton
2017-10-02 19:26     ` Dmitry A. Kazakov [this message]
replies disabled

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