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

List of all callback defined by CcMqMsgque

The callback have to be a interface, instance-callback or class-callback.

There a two different types of callback:

  1. A callback used to define a context
  2. A callback used to define a service

Callback signature

The callback is implemented as:

type code example
interface ccmqmsgque::IService Filter4
instance-callback ccmqmsgque::MqContextC::MqTokenICB manfilter
class-callback ccmqmsgque::MqContextC::MqTokenCCB Filter6

Using the signature:

class IService {
public:
virtual void Service (MqContextC * const ctx) = 0;
};
typedef IService MqServiceIF;
typedef void (MqContextC::*MqTokenICB) ();
typedef MqTokenICB MqBgErrorICB;
typedef MqTokenICB MqServiceICB;
typedef MqTokenICB MqServerSetupICB;
typedef MqTokenICB MqServerCleanupICB;
typedef MqTokenICB MqEventICB;
typedef void (*MqTokenCCB) (MqContextC*);
typedef MqTokenCCB MqBgErrorCCB;
typedef MqTokenCCB MqServiceCCB;
typedef MqTokenCCB MqServerSetupCCB;
typedef MqTokenCCB MqServerCleanupCCB;
typedef MqTokenCCB MqEventCCB;

Example from MyServer.cc using MqServiceCreate with callback ccmqmsgque::MqContextC::MqServiceICB

#include "LibMqMsgque_cc.hh"

using namespace ccmqmsgque;

// package-item
class MyServer : public MqContextC, public IServerSetup {
  friend class MqFactoryCT<MyServer>;
  private:
    // define the factory constructor
    MyServer(MK_TYP const typ, MqContextC* tmpl=NULL) : MqContextC(typ,tmpl) {};

  private:
    // service to serve all incoming requests for token "HLWO"
    void MyFirstService () {
      SendSTART();
      SendV("%s World", ReadSTR());
      SendRETURN();
    }

    // define a service as link between the token "HLWO" and the callback "MyFirstService"
    void ServerSetup() {
      ServiceCreate("HLWO", MqServiceICB(&MyServer::MyFirstService));
    }
};

// package-main
int MK_CDECL main(int argc, MK_STRN argv[]) {
  MqMsgque::Setup();

  // setup commandline arguments for later use
  MkBufferListC largs = {argc, argv};
  // create "MyServer" factory… and make it to the default.
  MqFactoryCT<MyServer>::Add("MyServer")->Default();
  // inspect commandline-argument for the "factory" to choose… and create a object
  auto srv = MqFactoryCT<MqContextC>::GetCalled(largs)->New();
  // start listen for incoming call's
  try {
    srv->LinkCreate(largs);
    srv->ProcessEvent (MQ_WAIT_FOREVER);
  } catch (const std::exception& e) {
    srv->ErrorCatch(e);
  }
  srv->Exit();
}

Callbacks defined by CcMqMsgque

Member libmqmsgque::MqSendEND_AND_CALLBACK_RT (MK_RT const mkrt, MQ_CTX const ctx, MQ_TOK const token, MqServiceCallbackF const fCall, MK_CBP callback, MqDataFreeF fFree, MK_TIME_T const timeout)
MqSendEND_AND_CALLBACK
Member libmqmsgque::MqSendEND_AND_SUB_RT (MK_RT const mkrt, MQ_CTX const ctx, MQ_TOK const token, MqServiceCallbackF const fCall, MK_CBP callback, MqDataFreeF fFree, MK_TIME_T timeout)
MqSendEND_AND_SUB
Member libmqmsgque::MqServiceCreate_RT (MK_RT const mkrt, MQ_CTX const ctx, MQ_TOK const token, MqServiceCallbackF const fCall, MK_CBP callback, MqDataFreeF fFree, MkMarkF fMark)
MqServiceCreate
Member libmqmsgque::MqSetupS::BgError
ConfigApi_IBgError
Member libmqmsgque::MqSetupS::Event
ConfigApi_IEvent
Member libmqmsgque::MqSetupS::ServerCleanup
ConfigApi_IServerCleanup
Member libmqmsgque::MqSetupS::ServerSetup
ConfigApi_IServerSetup