theLink 10.0
Loading...
Searching...
No Matches
ccmqmsgque::MqServiceCallbackC Struct Reference

infrastructur to use the ccmqmsgque specific callbackMore...

#include <MqCall_cc.hh>

+ Collaboration diagram for ccmqmsgque::MqServiceCallbackC:

Classes

union  MqServiceCallbackU
 storage to hold the callback More...
 

Public Types

enum  MqServiceCallbackE {
  PC_MqTokenICB , PC_MqTokenCCB , PC_MqServiceIF , PC_MqEventIF ,
  PC_MqServerSetupIF , PC_MqServerCleanupIF , PC_MqBgErrorIF
}
 

Static Public Member Functions

static MK_CBP Create (MK_RT mkrt, MqContextC::MqTokenICB const callback, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MqContextC::MqTokenCCB const callback, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MqServiceIF *const service, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MqEventIF *const event, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MqServerSetupIF *const serverSetup, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MqServerCleanupIF *const serverCleanup, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MqBgErrorIF *const bgError, MqContextC *self=NULL)
 
static MK_CBP Create (MK_RT mkrt, MQ_CTX const context, MqServiceCallbackC *const copy, MqContextC *self=NULL)
 
static enum MkErrorE Call (MQ_SERVICE_CALL_ARGS)
 
static void Free (MQ_SERVICE_FREE_ARGS)
 
static void Copy (MQ_SERVICE_COPY_ARGS)
 

Public Attributes

enum ccmqmsgque::MqServiceCallbackC::MqServiceCallbackE type
 
union ccmqmsgque::MqServiceCallbackC::MqServiceCallbackU call
 
MqContextCself
 

Private Member Functions

 MqServiceCallbackC (enum MqServiceCallbackE type, union MqServiceCallbackU call, MqContextC *self)
 

Detailed Description

infrastructur to use the ccmqmsgque specific callback

Definition at line 18 of file MqCall_cc.hh.

Member Enumeration Documentation

◆ MqServiceCallbackE

Enumerator
PC_MqTokenICB 
PC_MqTokenCCB 
PC_MqServiceIF 
PC_MqEventIF 
PC_MqServerSetupIF 
PC_MqServerCleanupIF 
PC_MqBgErrorIF 

Definition at line 19 of file MqCall_cc.hh.

Constructor & Destructor Documentation

◆ MqServiceCallbackC()

ccmqmsgque::MqServiceCallbackC::MqServiceCallbackC ( enum MqServiceCallbackE type,
union MqServiceCallbackU call,
MqContextC * self )
inlineprivate

Definition at line 52 of file MqCall_cc.hh.

52 : \
53 type(type), call(call), self(self) {};
union ccmqmsgque::MqServiceCallbackC::MqServiceCallbackU call
+ Here is the caller graph for this function:

Member Function Documentation

◆ Call()

enum MkErrorE ccmqmsgque::MqServiceCallbackC::Call ( MQ_SERVICE_CALL_ARGS )
static

Definition at line 78 of file MqCall_cc.cc.

79 {
81
82 MqServiceCallbackC * const pdata = static_cast<struct MqServiceCallbackC * const> (__data__);
83 MqContextC *self = MqContextC::MqContextC_GetSelf(mqctx);
84 try {
85
86 switch (pdata->type) {
87 case PC_MqTokenICB:
88 (self->*pdata->call.Callback)();
89 break;
90 case PC_MqTokenCCB:
91 (*pdata->call.StaticCallback)(self);
92 break;
93 case PC_MqServiceIF:
94 (pdata->call.Service->Service)(self);
95 break;
96 case PC_MqEventIF:
97 (pdata->call.Event->Event)();
98 break;
99 case PC_MqBgErrorIF:
100 (pdata->call.BgError->BgError)();
101 break;
103 (pdata->call.ServerSetup->ServerSetup)();
104 break;
106 (pdata->call.ServerCleanup->ServerCleanup)();
107 break;
108 }
109
110 } catch (const MkExceptionC& ex) {
111 MkExceptionC::Catch(mqctx,ex);
112 } catch (const std::exception& ex) {
113 MkExceptionC::Catch(mqctx,ex);
114 } catch (...) {
115 // http://groups.google.com/group/comp.programming.threads/browse_thread/thread/652bcf186fbbf697/f63757846514e5e5
116 throw;
117 }
118
119 // everything is OK
120 return MkErrorStack_0E_Check();
121 }
#define MkErrorStack_0E_Check()
static MK_ERR Catch(MK_MNGN const expobj, std::exception const *exception, MK_STRN const callfunc=__builtin_FUNCTION())
MkExceptionC(MK_ERR err, MK_STRN const caller, MK_I32 const line)
static MqContextC * MqContextC_GetSelf(MQ_CTX hdl)
#define MQ_SERVICE_CALL_CHECK
MqServiceCallbackC(enum MqServiceCallbackE type, union MqServiceCallbackU call, MqContextC *self)
Definition MqCall_cc.hh:52
+ Here is the caller graph for this function:

◆ Copy()

void ccmqmsgque::MqServiceCallbackC::Copy ( MQ_SERVICE_COPY_ARGS )
static

Definition at line 73 of file MqCall_cc.cc.

74 {
75 *dataP = MqServiceCallbackC::Create(MK_RT_CALL mqctx, static_cast<struct MqServiceCallbackC *> (*dataP));
76 }
#define MK_RT_CALL
static MK_CBP Create(MK_RT mkrt, MqContextC::MqTokenICB const callback, MqContextC *self=NULL)
Definition MqCall_cc.hh:57
+ Here is the caller graph for this function:

◆ Create() [1/8]

MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MQ_CTX const context,
MqServiceCallbackC *const copy,
MqContextC * self = NULL )
static

Definition at line 27 of file MqCall_cc.cc.

32 {
33 MqContextC * tgt = MqContextC::MqContextC_GetSelf(context);
34 MK_CBP ret = NULL;
35 switch (copy->type) {
36 case PC_MqEventIF: {
37 auto val = dynamic_cast<MqEventIF*const>(tgt);
38 ret = new MqServiceCallbackC(PC_MqEventIF, val, self);
39 if (!val) context->setup.Event.fCall = NULL;
40 break;
41 }
42 case PC_MqBgErrorIF: {
43 auto val = dynamic_cast<MqBgErrorIF*const>(tgt);
44 ret = new MqServiceCallbackC(PC_MqBgErrorIF, val, self);
45 if (!val) context->setup.BgError.fCall = NULL;
46 break;
47 }
48 case PC_MqServerSetupIF: {
49 auto val = dynamic_cast<MqServerSetupIF*const>(tgt);
50 ret = new MqServiceCallbackC(PC_MqBgErrorIF, val, self);
51 if (!val) context->setup.ServerSetup.fCall = NULL;
52 break;
53 }
55 auto val = dynamic_cast<MqServerCleanupIF*const>(tgt);
56 ret = new MqServiceCallbackC(PC_MqBgErrorIF, val, self);
57 if (!val) context->setup.ServerCleanup.fCall = NULL;
58 break;
59 }
60 default:
61 XE(context)
62 break;
63 }
64 return ret;
65 }
MK_PTRB * MK_CBP
MqServerCleanupIF MqServerCleanupIF
MqEventIF MqEventIF
MqServerSetupIF MqServerSetupIF
MqBgErrorIF MqBgErrorIF

◆ Create() [2/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqBgErrorIF *const bgError,
MqContextC * self = NULL )
inlinestatic

Definition at line 75 of file MqCall_cc.hh.

75 {
76 return new MqServiceCallbackC(PC_MqBgErrorIF,bgError, self);
77 }

◆ Create() [3/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqContextC::MqTokenCCB const callback,
MqContextC * self = NULL )
inlinestatic

Definition at line 60 of file MqCall_cc.hh.

60 {
61 return new MqServiceCallbackC(PC_MqTokenCCB,callback, self);
62 }

◆ Create() [4/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqContextC::MqTokenICB const callback,
MqContextC * self = NULL )
inlinestatic

Definition at line 57 of file MqCall_cc.hh.

57 {
58 return new MqServiceCallbackC(PC_MqTokenICB,callback, self);
59 }
+ Here is the caller graph for this function:

◆ Create() [5/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqEventIF *const event,
MqContextC * self = NULL )
inlinestatic

Definition at line 66 of file MqCall_cc.hh.

66 {
67 return new MqServiceCallbackC(PC_MqEventIF,event, self);
68 }

◆ Create() [6/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqServerCleanupIF *const serverCleanup,
MqContextC * self = NULL )
inlinestatic

Definition at line 72 of file MqCall_cc.hh.

72 {
73 return new MqServiceCallbackC(PC_MqServerCleanupIF,serverCleanup, self);
74 }

◆ Create() [7/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqServerSetupIF *const serverSetup,
MqContextC * self = NULL )
inlinestatic

Definition at line 69 of file MqCall_cc.hh.

69 {
70 return new MqServiceCallbackC(PC_MqServerSetupIF,serverSetup, self);
71 }

◆ Create() [8/8]

static MK_CBP ccmqmsgque::MqServiceCallbackC::Create ( MK_RT mkrt,
MqServiceIF *const service,
MqContextC * self = NULL )
inlinestatic

Definition at line 63 of file MqCall_cc.hh.

63 {
64 return new MqServiceCallbackC(PC_MqServiceIF,service, self);
65 }

◆ Free()

void ccmqmsgque::MqServiceCallbackC::Free ( MQ_SERVICE_FREE_ARGS )
static

Definition at line 67 of file MqCall_cc.cc.

68 {
69 delete static_cast<MqServiceCallbackC*>(*dataP);
70 *dataP = NULL;
71 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ call

union ccmqmsgque::MqServiceCallbackC::MqServiceCallbackU ccmqmsgque::MqServiceCallbackC::call

◆ self

MqContextC* ccmqmsgque::MqServiceCallbackC::self

Definition at line 49 of file MqCall_cc.hh.

◆ type

enum ccmqmsgque::MqServiceCallbackC::MqServiceCallbackE ccmqmsgque::MqServiceCallbackC::type

The documentation for this struct was generated from the following files: