theLink 10.0
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)
 
static void ccmqmsgque::MqContextC::MqContextC_selfUnlink (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 174 of file MqContextC_cc.hh.

◆ MqTokenICB

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

instance-callback

Definition at line 166 of file MqContextC_cc.hh.

Function Documentation

◆ Check()

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

check if pointer is still valid

Definition at line 157 of file MqContextC_cc.hh.

157 {
158 return (hdl && MqCtxCheck(hdl));
159 };
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 2365 of file MqContextC_inline_cc.hh.

2365 {
2367 MQ_CTX tmpl_hdl = MqContextC::getCTX__null_allow(tmpl);
2368 MQ_CTX __retVal__L = MqContextCreate(typ, tmpl_hdl);
2369 if (__retVal__L == NULL) {
2370 throw MkInitError("MqContextC::CTOR");
2371 }
2372 return (MK_OBJ)__retVal__L;
2373 }
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 89 of file MqContextC_cc.hh.

89 {
90 MQ_CTX ret = reinterpret_cast<MQ_CTX>(hdl);
91 if (unlikely(ret == NULL)) InstHdlIsNullError();
92 return ret;
93 };
#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 137 of file MqContextC_cc.hh.

137 {
138 return clsHdl.getCTX();
139 };

◆ getCTX() [3/3]

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

return LibMsgqueObject from current MqContextC pointer

Definition at line 113 of file MqContextC_cc.hh.

113 {
114 MQ_CTX ret = clsHdl ? reinterpret_cast<MQ_CTX>(clsHdl->hdl) : NULL;
115 if (unlikely(ret == NULL)) ClassHdlIsNullError(MqContextC);
116 return ret;
117 };

◆ getCTX__null_allow() [1/3]

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

return the LibMsgqueObject from current MqContextC instance

Definition at line 96 of file MqContextC_cc.hh.

96 {
97 return reinterpret_cast<MQ_CTX>(hdl);
98 };
+ 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 142 of file MqContextC_cc.hh.

142 {
143 return clsHdl.getCTX__null_allow();
144 };

◆ 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 120 of file MqContextC_cc.hh.

120 {
121 return clsHdl ? reinterpret_cast<MQ_CTX>(clsHdl->hdl) : NULL;
122 };

◆ getCTXN() [1/3]

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

(const) return the LibMsgqueObject from current MqContextC instance

Definition at line 101 of file MqContextC_cc.hh.

101 {
102 MQ_CTXN ret = reinterpret_cast<MQ_CTXN>(hdl);
103 if (unlikely(ret == NULL)) InstHdlIsNullError();
104 return ret;
105 };
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 147 of file MqContextC_cc.hh.

147 {
148 return clsHdl.getCTXN();
149 };

◆ getCTXN() [3/3]

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

(const) return LibMsgqueObject from current MqContextC pointer

Definition at line 125 of file MqContextC_cc.hh.

125 {
126 MQ_CTXN ret = clsHdl ? reinterpret_cast<MQ_CTXN>(clsHdl->hdl) : NULL;
127 if (unlikely(ret == NULL)) ClassHdlIsNullError(MqContextC);
128 return ret;
129 };

◆ 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 108 of file MqContextC_cc.hh.

108 {
109 return reinterpret_cast<MQ_CTXN>(hdl);
110 };
+ 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 152 of file MqContextC_cc.hh.

152 {
153 return clsHdl.getCTXN__null_allow();
154 };

◆ 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 132 of file MqContextC_cc.hh.

132 {
133 return clsHdl ? reinterpret_cast<MQ_CTXN>(clsHdl->hdl) : NULL;
134 };

◆ Init()

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

Definition at line 123 of file LibMqMsgque_cc.cc.

123 {
124 MQ_CTX ctx = reinterpret_cast<MQ_CTX>(hdl);
125 MkRtSetup_X(ctx);
126
127 // use "ctx->setup.Parent.fCreate" to ckeck in context was initialized
128 if (ctx->bits.Init_LOCK == true) return;
129 ctx->bits.Init_LOCK = true;
130
131 // init the server interface
132 MqServerSetupIF * const iSetup = dynamic_cast<MqServerSetupIF*const>(this);
133 if (iSetup != NULL) {
136 }
137 MqServerCleanupIF * const iCleanup = dynamic_cast<MqServerCleanupIF*const>(this);
138 if (iCleanup != NULL) {
141 }
142
143 // init the error interface
144 MqBgErrorIF * const iBgError = dynamic_cast<MqBgErrorIF*const>(this);
145 if (iBgError != NULL) {
148 }
149
150 // init the event interface
151 MqEventIF * const iEvent = dynamic_cast<MqEventIF*const>(this);
152 if (iEvent != NULL) {
155 }
156 }
#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:57
static enum MkErrorE Call(MQ_SERVICE_CALL_ARGS)
Definition MqCall_cc.cc:78
static void Copy(MQ_SERVICE_COPY_ARGS)
Definition MqCall_cc.cc:73
static void Free(MQ_SERVICE_FREE_ARGS)
Definition MqCall_cc.cc:67
+ Here is the caller graph for this function:

◆ isChild()

bool ccmqmsgque::MqContextC::isChild ( )
inline

Definition at line 1321 of file MqContextC_cc.hh.

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

◆ isMaster()

bool ccmqmsgque::MqContextC::isMaster ( )
inline

Definition at line 1322 of file MqContextC_cc.hh.

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

◆ isParent()

bool ccmqmsgque::MqContextC::isParent ( )
inline

Definition at line 1320 of file MqContextC_cc.hh.

1320{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 1323 of file MqContextC_cc.hh.

1323{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 74 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 80 of file MqContextC_cc.hh.

#define MqContextC_X2obj(x)

◆ MqContextC_GetSelf()

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

Definition at line 45 of file MqContextC_cc.hh.

45 {
46 return (hdl != NULL ? static_cast<MqContextC*>((*MqContextC_X2obj(hdl)).self) : &MK_NULL_REF);
47 }
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 66 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 69 of file MqContextC_cc.hh.

69 {
71 }
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 84 of file MqContextC_cc.hh.

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

◆ MqContextC_selfCreate()

static MK_PTR ccmqmsgque::MqContextC::MqContextC_selfCreate ( MK_RT_ARGS MK_OBJ obj,
MK_PTR const env )
inlinestaticprivate

Definition at line 52 of file MqContextC_cc.hh.

52 {
53 return new MqContextC(obj);
54 }
+ 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 57 of file MqContextC_cc.hh.

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

◆ MqContextC_selfUnlink()

static void ccmqmsgque::MqContextC::MqContextC_selfUnlink ( MK_RT_ARGS MK_PTR self,
MK_PTR env )
inlinestaticprivate

Definition at line 61 of file MqContextC_cc.hh.

61 {
62 MqContextC* selfO = static_cast<MqContextC*>(self);
63 selfO->atomUnlink();
64 }
+ Here is the caller graph for this function:

◆ operator MqContextC *()

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

Definition at line 182 of file MqContextC_cc.hh.

182{ return this; };

Variable Documentation

◆ MK_NULL_REF

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

Definition at line 41 of file MqContextC_cc.hh.