theKernel 10.0
Loading...
Searching...
No Matches
Callback Signature List

List of all callback defined by atlmkkernel

The callback is a regular ATL proc that either stands alone or is part of a class.

callback resolution

The callback is a list: [list ?class::?callback ?instance? args...], with automatic callback-name resolution occurs in the following order:

  1. The current-namespace in which the command containing the callback argument was executed.
  2. The global-namespace (::).
  3. The class-namespace (__CLASS__) if the callback is followed by an instance.

If automatic resolution does NOT produce the desired result, the callback can of course always be specified with the absolute-namespace.

additional parameters

ATL also allows additional parameters to be passed to the callback, for example, to support a specific implementation. These parameters are added at the end of the callback-call.

Example: The instance-callback with two default-arguments (arg1 and arg2), defined as:

  • define-callback-command [list callback instance add1 add2 add3]

results in the following callback call:

  • ::class::callback instance arg1 arg2 add1 add2 add3
See also
Read more about how to define a service-callback in theLink .

MkKernel callback

Callback signature

  • MkObjectDeleteCallbackSetup
    callback-args := typeName:MK_STRN[in], typeHdl:MK_HDL[in], objHdl:MK_HDL[in]
    [proc] proc callback { callback-args ?additional-args...? } ...
    MkObjectC::DeleteCallbackSetup "NAME" callback "FILTER"
    [instance] myooX::ClassN ::XXX {
    proc callback { xxxNs callback-args ?additional-args...? } ...
    }
    MkObjectC::DeleteCallbackSetup "NAME" [list callback $xxxNs] "FILTER"
    [class] myooX::ClassN ::YYY {
    proc callback { callback-args ?additional-args...? } ...
    }
    MkObjectC::DeleteCallbackSetup "NAME" ::YYY::callback "FILTER"

Callback example from RPC server

Example about the delete-callback-setup from the RPC server example/atl/LibSq3LiteRpcServer.atl

ServerSetup : The DeleteCallback is usually installed in the Setup-Callback but only once.

    if {[ConfigGetIsParent $myNs ]} {
      MkObjectC::DeleteCallbackSetup "LibSq3LiteRpcServer" [list ObjectDeleteCall $myNs] "^Sq3"
    }

The DeleteCallback is called before the deletion. In the RPC example, the RPC client is informed about the impending deletion.

  proc LibSq3LiteRpcServer::ObjectDeleteCall { myNs typeName typeHdl objHdl } {
    Send $myNs "E" "%DEL:CHH" $typeName $typeHdl $objHdl
  }

ServerCleanup : If the RPC server is deleted, the DeleteCallback is no longer needed and is therefore also deleted.

    if {[ConfigGetIsParent $myNs ]} {
      MkObjectC::DeleteCallbackCleanup "LibSq3LiteRpcServer"
    }

Callback defined by atlmkkernel

Global MkObjectDeleteCallbackSetup_RT (MK_RT mkrt, MK_STRN ident, MkObjectDeleteCallF fCall, MK_CBP callback, MkObjectDeleteFreeF fFree, MK_STRN filter)
MkObjectDeleteCallbackSetup