theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - cs - py - rb - jv - cc
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_ARGS MK_OBJ obj, MK_PTR const env)
 
static void ccmqmsgque::MqContextC::MqContextC_selfDelete (MK_RT_ARGS MK_PTR self, MK_PTR env)
 
void ccmqmsgque::MqContextC::MqContextC_Init (MQ_CTX hdl)
 
static MqContextCccmqmsgque::MqContextC::MqContextC_ObjCreate (MK_RT_ARGS MQ_CTX hdl)
 
 ccmqmsgque::MqContextC::MqContextC (MK_OBJ obj)
 
 ccmqmsgque::MqContextC::MqContextC (MQ_CTX hdl)
 
static MqContextCccmqmsgque::MqContextC::MqContextC_ObjNew (MK_RT_ARGS MQ_CTX hdl)
 return MqContextC from LibMsgqueObject
 
MQ_CTX ccmqmsgque::MqContextC::getCTX () const
 return the LibMsgqueObject from current MqContextC instance
 
MQ_CTX ccmqmsgque::MqContextC::getCTX__null_allow () const
 return the LibMsgqueObject from current MqContextC instance
 
MQ_CTXN ccmqmsgque::MqContextC::getCTXN () const
 (const) return the LibMsgqueObject from current MqContextC instance
 
MQ_CTXN ccmqmsgque::MqContextC::getCTXN__null_allow () const
 (const) return the LibMsgqueObject from current MqContextC instance
 
static MQ_CTX ccmqmsgque::MqContextC::getCTX (MqContextC *clsHdl)
 return LibMsgqueObject from current MqContextC pointer
 
static MQ_CTX ccmqmsgque::MqContextC::getCTX__null_allow (MqContextC *clsHdl)
 return LibMsgqueObject from current MqContextC pointer
 
static MQ_CTXN ccmqmsgque::MqContextC::getCTXN (const MqContextC *clsHdl)
 (const) return LibMsgqueObject from current MqContextC pointer
 
static MQ_CTXN ccmqmsgque::MqContextC::getCTXN__null_allow (const MqContextC *clsHdl)
 (const) return LibMsgqueObject from current MqContextC pointer
 
static MQ_CTX ccmqmsgque::MqContextC::getCTX (const MqContextC &clsHdl)
 return LibMsgqueObject from current MqContextC reference
 
static MQ_CTX ccmqmsgque::MqContextC::getCTX__null_allow (const MqContextC &clsHdl)
 return LibMsgqueObject from current MqContextC reference
 
static MQ_CTXN ccmqmsgque::MqContextC::getCTXN (const MqContextC &clsHdl)
 (const) return LibMsgqueObject from current MqContextC reference
 
static MQ_CTXN ccmqmsgque::MqContextC::getCTXN__null_allow (const MqContextC &clsHdl)
 (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
MqServerSetupIF define the server-setup-interface (callback) used on startup …
ServiceCreate create a link between a service-token and a service-callback
MqServerCleanupIF 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 166 of file MqContextC_cc.hh.

◆ MqTokenICB

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

instance-callback

Definition at line 158 of file MqContextC_cc.hh.

Function Documentation

◆ Check()

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

check if pointer is still valid

Definition at line 149 of file MqContextC_cc.hh.

149 {
150 return (hdl && MqCtxCheck(hdl));
151 };
static 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 2617 of file MqContextC_inline_cc.hh.

2617 {
2619 MQ_CTX tmpl_hdl = MqContextC::getCTX__null_allow(tmpl);
2620 MQ_CTX __retVal__L = MqContextCreate(typ, tmpl_hdl);
2621 if (__retVal__L == NULL) {
2622 throw MkInitError("MqContextC::CTOR");
2623 }
2624 return (MK_OBJ)__retVal__L;
2625 }
struct MkObjectS * MK_OBJ
#define MkRtSetup_NULL
MQ_CTX getCTX__null_allow() 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 ( ) const
inline

return the LibMsgqueObject from current MqContextC instance

Definition at line 81 of file MqContextC_cc.hh.

81 {
82 MQ_CTX ret = reinterpret_cast<MQ_CTX>(hdl);
83 if (unlikely(ret == NULL)) InstHdlIsNullError();
84 return ret;
85 };
#define unlikely(x)

◆ getCTX() [2/3]

static MQ_CTX ccmqmsgque::MqContextC::getCTX ( const MqContextC & clsHdl)
inlinestatic

return LibMsgqueObject from current MqContextC reference

Definition at line 129 of file MqContextC_cc.hh.

129 {
130 return clsHdl.getCTX();
131 };

◆ getCTX() [3/3]

static MQ_CTX ccmqmsgque::MqContextC::getCTX ( MqContextC * clsHdl)
inlinestatic

return LibMsgqueObject from current MqContextC pointer

Definition at line 105 of file MqContextC_cc.hh.

105 {
106 MQ_CTX ret = clsHdl ? reinterpret_cast<MQ_CTX>(clsHdl->hdl) : NULL;
107 if (unlikely(ret == NULL)) ClassHdlIsNullError(MqContextC);
108 return ret;
109 };

◆ getCTX__null_allow() [1/3]

MQ_CTX ccmqmsgque::MqContextC::getCTX__null_allow ( ) const
inline

return the LibMsgqueObject from current MqContextC instance

Definition at line 88 of file MqContextC_cc.hh.

88 {
89 return reinterpret_cast<MQ_CTX>(hdl);
90 };
+ Here is the caller graph for this function:

◆ getCTX__null_allow() [2/3]

static MQ_CTX ccmqmsgque::MqContextC::getCTX__null_allow ( const MqContextC & clsHdl)
inlinestatic

return LibMsgqueObject from current MqContextC reference

Definition at line 134 of file MqContextC_cc.hh.

134 {
135 return clsHdl.getCTX__null_allow();
136 };

◆ getCTX__null_allow() [3/3]

static MQ_CTX ccmqmsgque::MqContextC::getCTX__null_allow ( MqContextC * clsHdl)
inlinestatic

return LibMsgqueObject from current MqContextC pointer

Definition at line 112 of file MqContextC_cc.hh.

112 {
113 return clsHdl ? reinterpret_cast<MQ_CTX>(clsHdl->hdl) : NULL;
114 };

◆ getCTXN() [1/3]

MQ_CTXN ccmqmsgque::MqContextC::getCTXN ( ) const
inline

(const) return the LibMsgqueObject from current MqContextC instance

Definition at line 93 of file MqContextC_cc.hh.

93 {
94 MQ_CTXN ret = reinterpret_cast<MQ_CTXN>(hdl);
95 if (unlikely(ret == NULL)) InstHdlIsNullError();
96 return ret;
97 };
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)
inlinestatic

(const) return LibMsgqueObject from current MqContextC reference

Definition at line 139 of file MqContextC_cc.hh.

139 {
140 return clsHdl.getCTXN();
141 };

◆ getCTXN() [3/3]

static MQ_CTXN ccmqmsgque::MqContextC::getCTXN ( const MqContextC * clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MqContextC pointer

Definition at line 117 of file MqContextC_cc.hh.

117 {
118 MQ_CTXN ret = clsHdl ? reinterpret_cast<MQ_CTXN>(clsHdl->hdl) : NULL;
119 if (unlikely(ret == NULL)) ClassHdlIsNullError(MqContextC);
120 return ret;
121 };

◆ getCTXN__null_allow() [1/3]

MQ_CTXN ccmqmsgque::MqContextC::getCTXN__null_allow ( ) const
inline

(const) return the LibMsgqueObject from current MqContextC instance

Definition at line 100 of file MqContextC_cc.hh.

100 {
101 return reinterpret_cast<MQ_CTXN>(hdl);
102 };
+ Here is the caller graph for this function:

◆ getCTXN__null_allow() [2/3]

static MQ_CTXN ccmqmsgque::MqContextC::getCTXN__null_allow ( const MqContextC & clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MqContextC reference

Definition at line 144 of file MqContextC_cc.hh.

144 {
145 return clsHdl.getCTXN__null_allow();
146 };

◆ getCTXN__null_allow() [3/3]

static MQ_CTXN ccmqmsgque::MqContextC::getCTXN__null_allow ( const MqContextC * clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MqContextC pointer

Definition at line 124 of file MqContextC_cc.hh.

124 {
125 return clsHdl ? reinterpret_cast<MQ_CTXN>(clsHdl->hdl) : NULL;
126 };

◆ 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 MqServerSetupIF * const iSetup = dynamic_cast<MqServerSetupIF*const>(this);
146 if (iSetup != NULL) {
149 }
150 MqServerCleanupIF * const iCleanup = dynamic_cast<MqServerCleanupIF*const>(this);
151 if (iCleanup != NULL) {
154 }
155
156 // init the error interface
157 MqBgErrorIF * const iBgError = dynamic_cast<MqBgErrorIF*const>(this);
158 if (iBgError != NULL) {
161 }
162
163 // init the event interface
164 MqEventIF * const iEvent = dynamic_cast<MqEventIF*const>(this);
165 if (iEvent != NULL) {
168 }
169 }
#define MK_RT_CALL
#define MkRtSetup_X(x)
#define MqConfigSetBgError(...)
#define MqConfigSetServerSetup(...)
#define MqConfigSetServerCleanup(...)
#define MqConfigSetEvent(...)
MqServerCleanupIF MqServerCleanupIF
MqEventIF MqEventIF
MqServerSetupIF MqServerSetupIF
MqBgErrorIF MqBgErrorIF
static MK_CBP Create(MK_RT mkrt, MqContextC::MqTokenICB const callback, MqContextC *self=NULL)
Definition MqCall_cc.hh:60
static enum MkErrorE Call(MQ_SERVICE_CALL_ARGS)
Definition MqCall_cc.cc:81
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 1313 of file MqContextC_cc.hh.

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

◆ isMaster()

bool ccmqmsgque::MqContextC::isMaster ( )
inline

Definition at line 1314 of file MqContextC_cc.hh.

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

◆ isParent()

bool ccmqmsgque::MqContextC::isParent ( )
inline

Definition at line 1312 of file MqContextC_cc.hh.

1312{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 1315 of file MqContextC_cc.hh.

1315{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 66 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 72 of file MqContextC_cc.hh.

#define MqContextC_X2obj(x)

◆ MqContextC_GetSelf()

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

Definition at line 48 of file MqContextC_cc.hh.

48 {
49 return (hdl != NULL ? static_cast<MqContextC*>((*MqContextC_X2obj(hdl)).self) : &MK_NULL_REF);
50 }
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 58 of file MqContextC_cc.hh.

void atomInit(MK_OBJ obj)

◆ MqContextC_ObjCreate()

static MqContextC * ccmqmsgque::MqContextC::MqContextC_ObjCreate ( MK_RT_ARGS MQ_CTX hdl)
inlinestaticprivate

Definition at line 61 of file MqContextC_cc.hh.

61 {
63 }
static MK_PTR atomObjCreate(MK_RT_ARGS MK_OBJ obj)
+ Here is the caller graph for this function:

◆ MqContextC_ObjNew()

static MqContextC * ccmqmsgque::MqContextC::MqContextC_ObjNew ( MK_RT_ARGS MQ_CTX hdl)
inlinestatic

return MqContextC from LibMsgqueObject

Definition at line 76 of file MqContextC_cc.hh.

76 {
78 }
static MK_PTR atomObjNew(MK_RT_ARGS MK_OBJ obj)
+ Here is the caller graph for this function:

◆ MqContextC_selfCreate()

MK_PTR ccmqmsgque::MqContextC::MqContextC_selfCreate ( MK_RT_ARGS 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_ARGS MK_PTR self,
MK_PTR env )
inlinestaticprivate

Definition at line 54 of file MqContextC_cc.hh.

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

◆ operator MqContextC *()

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

Definition at line 174 of file MqContextC_cc.hh.

174{ return this; };

Variable Documentation

◆ MK_NULL_REF

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

Definition at line 44 of file MqContextC_cc.hh.