theConfig 10.0
|
List of all callback defined by atllcconfig
The callback is a regular ATL proc that either stands alone or is part of a class.
The callback is a list: [list ?class::?callback ?instance? args...]
, with automatic callback-name resolution occurs in the following order:
If automatic resolution does NOT produce the desired result, the callback can of course always be specified with the absolute-namespace.
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
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" }
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" } }
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]] }