theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - jv - cc
Loading...
Searching...
No Matches
Callback Signature List

List of all callback defined by CcMkKernel

The callback have to be a C++ proc or method

Callback signature

typedef void (MkObjectC::*ccmkkernel::MkObjectC::MkObjectDeleteICB) (MkObjectC *);
typedef void (*ccmkkernel::MkObjectC::MkObjectDeleteCCB) (MkObjectC*,MkObjectC*);
typedef void (*ccmkkernel::MkObjectDeleteSCB) (MkObjectC*);
void(MkObjectC::*) MkObjectDeleteICB(MkObjectC *)
instance-callback
void(*) MkObjectDeleteCCB(MkObjectC *, MkObjectC *)
class-callback
void(* MkObjectDeleteSCB)(MkObjectC *)
static-callback
Note
For the C-language the fCall is the function called and the callback is the additional data. This is different for the non-C-languges from (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO).
For the non-C-language the fCall is internal and the callback is the target-language-callback as data attribute.

Read more about how to define a service-callback in theLink .

Callback example

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

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

      if (ConfigGetIsParent()) {
        // call “ObjectDeleteCall” ONLY when deleting an instance whose class name matches the regular expression “^Sq3”
        MkObjectC::DeleteCallbackSetup("LibSq3LiteRpcServer",
            MkObjectDeleteICB(&LibSq3LiteRpcServer::ObjectDeleteCall),"^Sq3");
      }

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

void LibSq3LiteRpcServer::ObjectDeleteCall ( MkObjectC *obj ) {
  Send("E","%DEL:CCIH",ConfigGetName(),obj->ToNameOfType(),obj->HandleGetOfType(),obj->HandleGet());
}

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

      if (ConfigGetIsParent()) {
        MkObjectC::DeleteCallbackSetup("LibSq3LiteRpcServer",
            MkObjectDeleteICB(&LibSq3LiteRpcServer::ObjectDeleteCall),"^Sq3");
      }

Callbacks defined by CcMkKernel

Member libmkkernel::MkObjectDeleteCallbackSetup_RT (MK_RT const mkrt, MK_STRN ident, MkObjectDeleteCallF fCall, MK_CBP callback, MkObjectDeleteFreeF fFree, MK_STRN filter)
MkObjectDeleteCallbackSetup