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

List of all callback defined by atllcconfig

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"
    }

LcConfig callback

Callback signature

  • LcConfigSetIncludeFunc
    callback-args := inclDir:String[in] path:String[in] ret:MkBufferListC[inout]
    [proc] proc callback { callback-args ?additional-args...? } ...
    LcConfigC::SetIncludeFunc $cfgNs callback
    [instance] myooX::ClassN ::XXX {
    proc callback { xxxNs callback-args ?additional-args...? } ...
    }
    LcConfigC::SetIncludeFunc $cfgNs [list callback $xxxNs]
    [class] myooX::ClassN ::YYY {
    proc callback { callback-args ?additional-args...? } ...
    }
    LcConfigC::SetIncludeFunc $cfgNs ::YYY::callback
  • LcConfigSetSettingDeleteFunc
    callback-args := hdl:EXPORT-HANDLE[in]
    [static] proc callback { callback-args ?additional-args...? } ...
    ::LcConfigC::SetSettingDeleteFunc $cfgNs callback
    [instance] myooX::ClassN ::XXX {
    proc callback { myNs callback-args ?additional-args...? } ...
    }
    ::LcConfigC::SetSettingDeleteFunc $cfgNs [list callback someNs]
    [class] myooX::ClassN ::YYY {
    proc callback { callback-args ?additional-args...? } ...
    }
    ::LcConfigC::SetSettingDeleteFunc $cfgNs ::YYY::callback

Callback example from RPC server

Callback setup
Example from LibLcConfigRpcServer.atl using LcConfigSetIncludeFunc with callback
  proc LibLcConfigRpcServer::LcConfigSetIncludeFunc {myNs} {
    set cfg [LcConfigC::HandleResolve [ReadI32 $myNs]]
    set fConfigIncludeData_ptr [ReadSTR $myNs]
    # use "fConfigIncludeData_ptr" as "method" resolved in TOPLEVEL class-namespace
    #   remember namespace resolution → CURRENT (::LibLcConfigRpcServer), GLOBAL (::), toplecel CLASS (::LcConfigServer)
    LcConfigC::SetIncludeFunc $cfg [list $fConfigIncludeData_ptr $myNs]
    if {[ServiceIsTransaction $myNs]} {
      Send $myNs "R"
    }
  }
Callback definition
Example from LcConfigServer.atl callback to be called
  # callback defined as "method" in "::LcConfigServer" ...
  proc include_func { myNs dir match ret } {
    MkBufferListC::AppendLA $ret [MkBufferListC::FileGlob [file join $dir $match]]
  }

Callback defined by atllcconfig

Global LcConfigSetIncludeFunc_RT (MK_RT mkrt, LC_CFG const cfg, LcConfigIncludeCallF fConfigIncludeCall, LC_CBP fConfigIncludeData, LcConfigIncludeFreeF fConfigIncludeFree)
LcConfigSetIncludeFunc
Global LcConfigSetSettingDeleteFunc_RT (MK_RT mkrt, LC_CFG const cfg, LcSettingDeleteCallF fSettingDeleteCall, LC_CBP fSettingDeleteData, LcSettingDeleteFreeF fSettingDeleteFree)
LcConfigSetSettingDeleteFunc