MqContextC - the class known as ctx or context is the application-handle of the application-server and also the main data-handle …
More...
|
static MqContextC * | ccmqmsgque::MqContextC::MqContextC_GetSelf (MQ_CTX hdl) |
|
static MK_PTR | ccmqmsgque::MqContextC::MqContextC_selfCreate (MK_RT const mkrt, MK_OBJ obj, MK_PTR const env) |
|
static void | ccmqmsgque::MqContextC::MqContextC_selfDelete (MK_RT const mkrt, MK_PTR self, MK_PTR env) |
|
void | ccmqmsgque::MqContextC::MqContextC_Init (MQ_CTX hdl) |
|
static MqContextC * | ccmqmsgque::MqContextC::MqContextC_ObjCreate (MK_RT const mkrt, MQ_CTX hdl) |
|
| ccmqmsgque::MqContextC::MqContextC (MK_OBJ obj) |
|
| ccmqmsgque::MqContextC::MqContextC (MQ_CTX hdl) |
|
static MqContextC * | ccmqmsgque::MqContextC::MqContextC_ObjNew (MK_RT const mkrt, MQ_CTX hdl) |
| return MqContextC from LibMsgqueObject
|
|
MQ_CTX | ccmqmsgque::MqContextC::getCTX (bool nullB=MK_NULL_NO) const |
| return the LibMsgqueObject from current MqContextC instance
|
|
MQ_CTXN | ccmqmsgque::MqContextC::getCTXN (bool nullB=MK_NULL_NO) const |
| (const) return the LibMsgqueObject from current MqContextC instance
|
|
static MQ_CTX | ccmqmsgque::MqContextC::getCTX (MqContextC *clsHdl, bool nullB=MK_NULL_NO) |
| return LibMsgqueObject from current MqContextC pointer
|
|
static MQ_CTXN | ccmqmsgque::MqContextC::getCTXN (const MqContextC *clsHdl, bool nullB=MK_NULL_NO) |
| (const) return LibMsgqueObject from current MqContextC pointer
|
|
static MQ_CTX | ccmqmsgque::MqContextC::getCTX (const MqContextC &clsHdl, bool nullB=MK_NULL_NO) |
| return LibMsgqueObject from current MqContextC reference
|
|
static MQ_CTXN | ccmqmsgque::MqContextC::getCTXN (const MqContextC &clsHdl, bool nullB=MK_NULL_NO) |
| (const) return LibMsgqueObject from current MqContextC reference
|
|
bool | ccmqmsgque::MqContextC::Check () const |
| check if pointer is still valid
|
|
void | ccmqmsgque::MqContextC::Init (MK_STRN caller=__builtin_FUNCTION()) |
|
| ccmqmsgque::MqContextC::operator MqContextC * () |
|
static MK_OBJ | ccmqmsgque::MqContextC::CTOR (MK_TYP const typ, MqContextC *tmpl=NULL) |
| MqContextCreate
|
|
MqContextC - the class known as ctx or context is the application-handle of the application-server and also the main data-handle …
The context is the package-item with the required features and created by the implementation-layer-programmer. The context can be a client or a server.
- HOWTO client-context
The client-context-creation is triggerd by the software-workflow on demand. The client is calling the MqLinkCreate to create a connection to the server using the connection-arguments to specify the target.
The life-cycle of a client is:
- HOWTO server-context
The server-context-creation is always triggerd by the MqLinkCreate command of the client. The server is usually using a factory-constructor to call the MqContextCreate and finally to call the MqContextDelete.
The server-context is fully under control of the client.
The life-cycle of a server is:
SETUP | define a class and add the setup/cleanup code |
IServerSetup | define the server-setup-interface (callback) used on startup … |
ServiceCreate | create a link between a service-token and a service-callback … |
IServerCleanup | define the server-cleanup-interface (callback) used on cleanup … |
ServiceDelete | delete a service. … |
STARTUP | define the factory and start the listener |
FactoryAdd | add a new MqFactoryC identified by factory-identifier and defined by factory-constructor … |
FactoryNew | create a new MqContextC from a MqFactoryC … |
LinkCreate | make ctx to a parent-context and setup a new client-server-link … |
ProcessEvent | enter the event-loop and wait for an incoming service-request. … |
WORK | process the service-calls and exit on end |
ReadTT | read a PRIMITIVE TYPE from the read-data-package … |
SendTT | MqContextC - append a native PRIMITIVE TYPE value to the send-data-package … |
Exit | delete the context and exit the current process or thread … |
MqContextC* CTOR and DTOR
The context is the package-item with the required features and created by the implementation-layer-programmer. The context can be a client or a server.
- HOWTO client-context
The client-context-creation is triggerd by the software-workflow on demand. The client is calling the MqLinkCreate to create a connection to the server using the connection-arguments to specify the target.
The life-cycle of a client is:
- HOWTO server-context
The server-context-creation is always triggerd by the MqLinkCreate command of the client. The server is usually using a factory-constructor to call the MqContextCreate and finally to call the MqContextDelete.
The server-context is fully under control of the client.
The life-cycle of a server is:
SETUP | define a class and add the setup/cleanup code |
IServerSetup | define the server-setup-interface (callback) used on startup … |
ServiceCreate | create a link between a service-token and a service-callback … |
IServerCleanup | define the server-cleanup-interface (callback) used on cleanup … |
ServiceDelete | delete a service. … |
STARTUP | define the factory and start the listener |
FactoryAdd | add a new MqFactoryC identified by factory-identifier and defined by factory-constructor … |
FactoryNew | create a new MqContextC from a MqFactoryC … |
LinkCreate | make ctx to a parent-context and setup a new client-server-link … |
ProcessEvent | enter the event-loop and wait for an incoming service-request. … |
WORK | process the service-calls and exit on end |
ReadTT | read a PRIMITIVE TYPE from the read-data-package … |
SendTT | MqContextC - append a native PRIMITIVE TYPE value to the send-data-package … |
Exit | delete the context and exit the current process or thread … |
MqContextC* CTOR and DTOR
◆ MqBgErrorCCB
◆ MqBgErrorICB
◆ MqEventCCB
◆ MqEventICB
◆ MqServerCleanupCCB
◆ MqServerCleanupICB
◆ MqServerSetupCCB
◆ MqServerSetupICB
◆ MqServiceCCB
◆ MqServiceICB
◆ MqTokenCCB
void(*) ccmqmsgque::MqContextC::MqTokenCCB(MqContextC *) |
◆ MqTokenICB
void(MqContextC::*) ccmqmsgque::MqContextC::MqTokenICB() |
◆ Check()
bool ccmqmsgque::MqContextC::Check |
( |
| ) |
const |
|
inline |
check if pointer is still valid
Definition at line 121 of file MqContextC_cc.hh.
121 {
123 };
bool MqCtxCheck(MK_MNGN mng)
check MqContextS -> libmkkernel::MkObjectS::signature …
◆ CTOR()
MqContextCreate
Definition at line 2639 of file MqContextC_inline_cc.hh.
2639 {
2643 if (__retVal__L == NULL) {
2644 throw MkInitError("MqContextC::CTOR");
2645 }
2646 return (
MK_OBJ)__retVal__L;
2647 }
struct MkObjectS * MK_OBJ
MQ_CTX getCTX(bool nullB=MK_NULL_NO) const
return the LibMsgqueObject from current MqContextC instance
struct MqContextS * MQ_CTX
class-shortcut for struct MqContextS *, all shortcut using the XX_YYY syntax (only for public API) …
#define MqContextCreate(...)
◆ getCTX() [1/3]
return the LibMsgqueObject from current MqContextC instance
Definition at line 83 of file MqContextC_cc.hh.
83 {
85 if (
unlikely(!nullB && ret == NULL)) InstHdlIsNullError();
86 return ret;
87 };
◆ getCTX() [2/3]
return LibMsgqueObject from current MqContextC reference
Definition at line 111 of file MqContextC_cc.hh.
111 {
112 return clsHdl.getCTX(nullB);
113 };
◆ getCTX() [3/3]
return LibMsgqueObject from current MqContextC pointer
Definition at line 97 of file MqContextC_cc.hh.
97 {
98 MQ_CTX ret = clsHdl ?
reinterpret_cast<MQ_CTX>(clsHdl->hdl) : NULL;
100 return ret;
101 };
◆ getCTXN() [1/3]
(const) return the LibMsgqueObject from current MqContextC instance
Definition at line 90 of file MqContextC_cc.hh.
90 {
92 if (
unlikely(!nullB && ret == NULL)) InstHdlIsNullError();
93 return ret;
94 };
const struct MqContextS * MQ_CTXN
class-shortcut for const struct MqContextS *, all const shortcut using the XX_YYYC syntax (only for p...
◆ getCTXN() [2/3]
(const) return LibMsgqueObject from current MqContextC reference
Definition at line 116 of file MqContextC_cc.hh.
116 {
117 return clsHdl.getCTXN(nullB);
118 };
◆ getCTXN() [3/3]
◆ Init()
void ccmqmsgque::MqContextC::Init |
( |
MK_STRN | caller = __builtin_FUNCTION() | ) |
|
Definition at line 136 of file LibMqMsgque_cc.cc.
136 {
139
140
141 if (ctx->bits.Init_LOCK == true) return;
142 ctx->bits.Init_LOCK = true;
143
144
145 IServerSetup * const iSetup = dynamic_cast<IServerSetup*const>(this);
146 if (iSetup != NULL) {
149 }
150 IServerCleanup * const iCleanup = dynamic_cast<IServerCleanup*const>(this);
151 if (iCleanup != NULL) {
154 }
155
156
157 IBgError * const iBgError = dynamic_cast<IBgError*const>(this);
158 if (iBgError != NULL) {
161 }
162
163
164 IEvent * const iEvent = dynamic_cast<IEvent*const>(this);
165 if (iEvent != NULL) {
168 }
169 }
#define MqConfigSetBgError(...)
#define MqConfigSetServerSetup(...)
#define MqConfigSetServerCleanup(...)
#define MqConfigSetEvent(...)
static enum MkErrorE Call(MQ_SERVICE_CALL_ARGS)
static MK_CBP Create(MK_RT const mkrt, MqContextC::MqTokenICB const callback, MqContextC *self=NULL)
static void Copy(MQ_SERVICE_COPY_ARGS)
static void Free(MQ_SERVICE_FREE_ARGS)
◆ isChild()
bool ccmqmsgque::MqContextC::isChild |
( |
| ) |
|
|
inline |
◆ isMaster()
bool ccmqmsgque::MqContextC::isMaster |
( |
| ) |
|
|
inline |
◆ isParent()
bool ccmqmsgque::MqContextC::isParent |
( |
| ) |
|
|
inline |
◆ isSlave()
bool ccmqmsgque::MqContextC::isSlave |
( |
| ) |
|
|
inline |
◆ MqContextC() [1/2]
ccmqmsgque::MqContextC::MqContextC |
( |
MK_OBJ | obj | ) |
|
|
inlineprivate |
◆ MqContextC() [2/2]
ccmqmsgque::MqContextC::MqContextC |
( |
MQ_CTX | hdl | ) |
|
|
inline |
◆ MqContextC_GetSelf()
Definition at line 50 of file MqContextC_cc.hh.
50 {
52 }
static thread_local MqContextC MK_NULL_REF
◆ MqContextC_Init()
void ccmqmsgque::MqContextC::MqContextC_Init |
( |
MQ_CTX | hdl | ) |
|
|
inlineprivate |
◆ MqContextC_ObjCreate()
Definition at line 63 of file MqContextC_cc.hh.
63 {
65 }
static MK_PTR atomObjCreate(MK_RT const mkrt, MK_OBJ obj)
◆ MqContextC_ObjNew()
return MqContextC from LibMsgqueObject
Definition at line 78 of file MqContextC_cc.hh.
78 {
80 }
static MK_PTR atomObjNew(MK_RT const mkrt, MK_OBJ obj)
◆ MqContextC_selfCreate()
◆ MqContextC_selfDelete()
static void ccmqmsgque::MqContextC::MqContextC_selfDelete |
( |
MK_RT const | mkrt, |
|
|
MK_PTR | self, |
|
|
MK_PTR | env ) |
|
inlinestaticprivate |
◆ operator MqContextC *()
◆ MK_NULL_REF