Loading...
Searching...
No Matches
MqContextC_CC_API

MqContextC - the class known as ctx or context is the application-handle of the application-server and also the main data-handleMore...

+ Collaboration diagram for MqContextC_CC_API:

Topics

 MqContextC_Class_CC_API
 MqContextC - define the class …
 
 MqContextC_TOR_CC_API
 MqContextC - various functions to create, initialize and destroy a context
 
 MqContextC_Config_CC_API
 MqContextC - various functions to config a context
 
 MqContextC_Link_CC_API
 
 MqContextC_SlaveApi_Slave_CC_API
 MqContextC - create and manage a slave context …
 
 MqContextC_SendApi_CC_API
 MqContextC - construct an outgoing send-data-package
 
 MqContextC_ReadApi_CC_API
 MqContextC - extract data from an incoming read-data-package
 
 MqContextC_Proxy_CC_API
 MqContextC - copy data from the read-data-package of the sourceCtx to the send-data-package of the targetCtx
 
 MqContextC_Route_CC_API
 MqContextC - setup and manage a routing-link
 
 MqContextC_Service_CC_API
 MqContextC - create and manage a service …
 
 MqContextC_StorageApi_CC_API
 MqContextC - setup and manage a storage used to persist data-packages
 
 MqContextC_High_CC_API
 MqContextC - User friendly replacement for the MqContextC_SendApi_C_API and the MqContextC_ReadApi_C_API
 
 MqContextC_Env_CC_API
 MqContextC - protect and restore the service-environment …
 
 MqContextC_Error_CC_API
 MqContextC - move and copy an error from a context
 
 MqContextC_Log_CC_API
 MqContextC - log the output to a string or a MkLogFileC
 
 MqContextC_Filter_CC_API
 MqContextC - modify the data using the filter-technology
 
 MqContextC_Misc_CC_API
 MqContextC - various functions to work on a context
 
 MqContextC_ClassApi_Class_CC_API
 MqContextC - access data related to the factory-type of the object …
 

Typedefs

typedef void(MqContextC::*) ccmqmsgque::MqContextC::MqTokenICB()
 instance-callback
 
typedef MqTokenICB ccmqmsgque::MqContextC::MqBgErrorICB
 
typedef MqTokenICB ccmqmsgque::MqContextC::MqServiceICB
 
typedef MqTokenICB ccmqmsgque::MqContextC::MqServerSetupICB
 
typedef MqTokenICB ccmqmsgque::MqContextC::MqServerCleanupICB
 
typedef MqTokenICB ccmqmsgque::MqContextC::MqEventICB
 
typedef void(*) ccmqmsgque::MqContextC::MqTokenCCB(MqContextC *)
 class-callback
 
typedef MqTokenCCB ccmqmsgque::MqContextC::MqBgErrorCCB
 
typedef MqTokenCCB ccmqmsgque::MqContextC::MqServiceCCB
 
typedef MqTokenCCB ccmqmsgque::MqContextC::MqServerSetupCCB
 
typedef MqTokenCCB ccmqmsgque::MqContextC::MqServerCleanupCCB
 
typedef MqTokenCCB ccmqmsgque::MqContextC::MqEventCCB
 

Functions

static MqContextCccmqmsgque::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 MqContextCccmqmsgque::MqContextC::MqContextC_ObjCreate (MK_RT const mkrt, MQ_CTX hdl)
 
 ccmqmsgque::MqContextC::MqContextC (MK_OBJ obj)
 
 ccmqmsgque::MqContextC::MqContextC (MQ_CTX hdl)
 
static MqContextCccmqmsgque::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
 

Variables

static thread_local MqContextC ccmqmsgque::MqContextC::MK_NULL_REF = {(MK_OBJ)0}
 

context-info

extract boolean information from context

bool ccmqmsgque::MqContextC::isParent ()
 
bool ccmqmsgque::MqContextC::isChild ()
 
bool ccmqmsgque::MqContextC::isMaster ()
 
bool ccmqmsgque::MqContextC::isSlave ()
 

Detailed Description

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:

ContextCreate create and initialize the MqContextC ...
LinkCreate make ctx to a parent-context and setup a new client-server-link
SendTT MqContextC - append a native PRIMITIVE TYPE value to the send-data-package
ReadTT read a PRIMITIVE TYPE from the read-data-package
LinkDelete close the client-server-link
ContextDelete Destructor - delete a MqContextC instance …
Exit delete the context and exit the current process or thread …

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:

SETUPdefine 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. …
STARTUPdefine 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. …
WORKprocess 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

command alias
[constructor,static] MqContextC* MqContextC::Create(MqContextC* tmpl = NULL) ccmqmsgque::MqContextC()
[destructor] ctx.Delete() delete ctx

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:

ContextCreate create and initialize the MqContextC ...
LinkCreate make ctx to a parent-context and setup a new client-server-link
SendTT MqContextC - append a native PRIMITIVE TYPE value to the send-data-package
ReadTT read a PRIMITIVE TYPE from the read-data-package
LinkDelete close the client-server-link
ContextDelete Destructor - delete a MqContextC instance …
Exit delete the context and exit the current process or thread …

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:

SETUPdefine 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. …
STARTUPdefine 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. …
WORKprocess 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

command alias
[constructor,static] MqContextC* MqContextC::Create(MqContextC* tmpl = NULL) ccmqmsgque::MqContextC()
[destructor] ctx.Delete() delete ctx

Typedef Documentation

◆ MqBgErrorCCB

◆ MqBgErrorICB

◆ MqEventCCB

◆ MqEventICB

◆ MqServerCleanupCCB

◆ MqServerCleanupICB

◆ MqServerSetupCCB

◆ MqServerSetupICB

◆ MqServiceCCB

◆ MqServiceICB

◆ MqTokenCCB

void(*) ccmqmsgque::MqContextC::MqTokenCCB(MqContextC *)

class-callback

Definition at line 138 of file MqContextC_cc.hh.

◆ MqTokenICB

void(MqContextC::*) ccmqmsgque::MqContextC::MqTokenICB()

instance-callback

Definition at line 130 of file MqContextC_cc.hh.

Function Documentation

◆ Check()

bool ccmqmsgque::MqContextC::Check ( ) const
inline

check if pointer is still valid

Definition at line 121 of file MqContextC_cc.hh.

121 {
122 return (hdl && MqCtxCheck(hdl));
123 };
bool MqCtxCheck(MK_MNGN mng)
check MqContextS -> libmkkernel::MkObjectS::signature …

◆ CTOR()

MK_OBJ ccmqmsgque::MqContextC::CTOR ( MK_TYP const typ,
MqContextC * tmpl = NULL )
inlinestaticprivate

MqContextCreate

Definition at line 2639 of file MqContextC_inline_cc.hh.

2639 {
2641 MQ_CTX tmpl_hdl = MqContextC::getCTX(tmpl, MK_NULL_YES);
2642 MQ_CTX __retVal__L = MqContextCreate(typ, tmpl_hdl);
2643 if (__retVal__L == NULL) {
2644 throw MkInitError("MqContextC::CTOR");
2645 }
2646 return (MK_OBJ)__retVal__L;
2647 }
#define MK_NULL_YES
struct MkObjectS * MK_OBJ
#define MkRtSetup_NULL
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]

MQ_CTX ccmqmsgque::MqContextC::getCTX ( bool nullB = MK_NULL_NO) const
inline

return the LibMsgqueObject from current MqContextC instance

Definition at line 83 of file MqContextC_cc.hh.

83 {
84 MQ_CTX ret = reinterpret_cast<MQ_CTX>(hdl);
85 if (unlikely(!nullB && ret == NULL)) InstHdlIsNullError();
86 return ret;
87 };
#define unlikely(x)

◆ getCTX() [2/3]

static MQ_CTX ccmqmsgque::MqContextC::getCTX ( const MqContextC & clsHdl,
bool nullB = MK_NULL_NO )
inlinestatic

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]

static MQ_CTX ccmqmsgque::MqContextC::getCTX ( MqContextC * clsHdl,
bool nullB = MK_NULL_NO )
inlinestatic

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;
99 if (unlikely(!nullB && ret == NULL)) ClassHdlIsNullError(MqContextC);
100 return ret;
101 };

◆ getCTXN() [1/3]

MQ_CTXN ccmqmsgque::MqContextC::getCTXN ( bool nullB = MK_NULL_NO) const
inline

(const) return the LibMsgqueObject from current MqContextC instance

Definition at line 90 of file MqContextC_cc.hh.

90 {
91 MQ_CTXN ret = reinterpret_cast<MQ_CTXN>(hdl);
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...
+ Here is the caller graph for this function:

◆ getCTXN() [2/3]

static MQ_CTXN ccmqmsgque::MqContextC::getCTXN ( const MqContextC & clsHdl,
bool nullB = MK_NULL_NO )
inlinestatic

(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]

static MQ_CTXN ccmqmsgque::MqContextC::getCTXN ( const MqContextC * clsHdl,
bool nullB = MK_NULL_NO )
inlinestatic

(const) return LibMsgqueObject from current MqContextC pointer

Definition at line 104 of file MqContextC_cc.hh.

104 {
105 MQ_CTXN ret = clsHdl ? reinterpret_cast<MQ_CTXN>(clsHdl->hdl) : NULL;
106 if (unlikely(!nullB && ret == NULL)) ClassHdlIsNullError(MqContextC);
107 return ret;
108 };

◆ Init()

void ccmqmsgque::MqContextC::Init ( MK_STRN caller = __builtin_FUNCTION())

Definition at line 136 of file LibMqMsgque_cc.cc.

136 {
137 MQ_CTX ctx = reinterpret_cast<MQ_CTX>(hdl);
138 MkRtSetup_X(ctx);
139
140 // use "ctx->setup.Parent.fCreate" to ckeck in context was initialized
141 if (ctx->bits.Init_LOCK == true) return;
142 ctx->bits.Init_LOCK = true;
143
144 // init the server interface
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 // init the error interface
157 IBgError * const iBgError = dynamic_cast<IBgError*const>(this);
158 if (iBgError != NULL) {
161 }
162
163 // init the event interface
164 IEvent * const iEvent = dynamic_cast<IEvent*const>(this);
165 if (iEvent != NULL) {
168 }
169 }
#define MK_RT_CALL
#define MkRtSetup_X(x)
#define MqConfigSetBgError(...)
#define MqConfigSetServerSetup(...)
#define MqConfigSetServerCleanup(...)
#define MqConfigSetEvent(...)
static enum MkErrorE Call(MQ_SERVICE_CALL_ARGS)
Definition MqCall_cc.cc:81
static MK_CBP Create(MK_RT const mkrt, MqContextC::MqTokenICB const callback, MqContextC *self=NULL)
Definition MqCall_cc.hh:58
static void Copy(MQ_SERVICE_COPY_ARGS)
Definition MqCall_cc.cc:76
static void Free(MQ_SERVICE_FREE_ARGS)
Definition MqCall_cc.cc:70
+ Here is the caller graph for this function:

◆ isChild()

bool ccmqmsgque::MqContextC::isChild ( )
inline

Definition at line 1288 of file MqContextC_cc.hh.

1288{return (MQ_IS_CHILD (reinterpret_cast<MQ_CTX>(hdl)));}
#define MQ_IS_CHILD(ctx)

◆ isMaster()

bool ccmqmsgque::MqContextC::isMaster ( )
inline

Definition at line 1289 of file MqContextC_cc.hh.

1289{return (MQ_IS_MASTER (reinterpret_cast<MQ_CTX>(hdl)));}
#define MQ_IS_MASTER(ctx)

◆ isParent()

bool ccmqmsgque::MqContextC::isParent ( )
inline

Definition at line 1287 of file MqContextC_cc.hh.

1287{return (MQ_IS_PARENT (reinterpret_cast<MQ_CTX>(hdl)));}
#define MQ_IS_PARENT(ctx)
+ Here is the caller graph for this function:

◆ isSlave()

bool ccmqmsgque::MqContextC::isSlave ( )
inline

Definition at line 1290 of file MqContextC_cc.hh.

1290{return (MQ_IS_SLAVE (reinterpret_cast<MQ_CTX>(hdl)));}
#define MQ_IS_SLAVE(ctx)

◆ MqContextC() [1/2]

ccmqmsgque::MqContextC::MqContextC ( MK_OBJ obj)
inlineprivate

Definition at line 68 of file MqContextC_cc.hh.

+ Here is the caller graph for this function:

◆ MqContextC() [2/2]

ccmqmsgque::MqContextC::MqContextC ( MQ_CTX hdl)
inline

Definition at line 74 of file MqContextC_cc.hh.

#define MqContextC_X2obj(x)

◆ MqContextC_GetSelf()

static MqContextC * ccmqmsgque::MqContextC::MqContextC_GetSelf ( MQ_CTX hdl)
inlinestaticprivate

Definition at line 50 of file MqContextC_cc.hh.

50 {
51 return (hdl != NULL ? static_cast<MqContextC*>((*MqContextC_X2obj(hdl)).self) : &MK_NULL_REF);
52 }
static thread_local MqContextC MK_NULL_REF
+ Here is the caller graph for this function:

◆ MqContextC_Init()

void ccmqmsgque::MqContextC::MqContextC_Init ( MQ_CTX hdl)
inlineprivate

Definition at line 60 of file MqContextC_cc.hh.

void atomInit(MK_OBJ obj)

◆ MqContextC_ObjCreate()

static MqContextC * ccmqmsgque::MqContextC::MqContextC_ObjCreate ( MK_RT const mkrt,
MQ_CTX hdl )
inlinestaticprivate

Definition at line 63 of file MqContextC_cc.hh.

63 {
65 }
static MK_PTR atomObjCreate(MK_RT const mkrt, MK_OBJ obj)
+ Here is the caller graph for this function:

◆ MqContextC_ObjNew()

static MqContextC * ccmqmsgque::MqContextC::MqContextC_ObjNew ( MK_RT const mkrt,
MQ_CTX hdl )
inlinestatic

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)
+ Here is the caller graph for this function:

◆ MqContextC_selfCreate()

MK_PTR ccmqmsgque::MqContextC::MqContextC_selfCreate ( MK_RT const mkrt,
MK_OBJ obj,
MK_PTR const env )
inlinestaticprivate

Definition at line 18 of file MqContextC_inline_cc.hh.

18 {
19 return new MqContextC(obj);
20 }
+ Here is the caller graph for this function:

◆ MqContextC_selfDelete()

static void ccmqmsgque::MqContextC::MqContextC_selfDelete ( MK_RT const mkrt,
MK_PTR self,
MK_PTR env )
inlinestaticprivate

Definition at line 56 of file MqContextC_cc.hh.

56 {
57 delete static_cast<MqContextC*>(self);
58 }
+ Here is the caller graph for this function:

◆ operator MqContextC *()

ccmqmsgque::MqContextC::operator MqContextC * ( )
inline

Definition at line 146 of file MqContextC_cc.hh.

146{ return this; };

Variable Documentation

◆ MK_NULL_REF

thread_local MqContextC ccmqmsgque::MqContextC::MK_NULL_REF = {(MK_OBJ)0}
static

Definition at line 46 of file MqContextC_cc.hh.