theLink 10.0
Loading...
Searching...
No Matches
LibMqMsgque_cc.cc
Go to the documentation of this file.
1
9/* LABEL-NO */
10
11#define META_FILE_NAME "LibMqMsgque_cc.cc"
12
13#include <typeinfo>
14#include <stdexcept>
15
16#include "private_cc.hh"
17#define META_CONTEXT_S hdl
18
19namespace ccmqmsgque {
20
21/* No longer used, PROBLEM: The order in which the STATIC destructors are called is NOT predictable
22
23 MqStaticC MqMsgque::mq_sta;
24
25 MqStaticC::MqStaticC() {
26 MqMsgque::Setup();
27 }
28
29 MqStaticC::~MqStaticC() {
30 MqMsgque::Cleanup();
31 }
32*/
33
36
37 // BUG FIX : 2 apr 2025 → read more at "pFactoryThreadDupCheck"
38 /* add new default factory */
39 if (!strcmp(MqFactoryCT<MqContextC>::InitialIdent(),"libmqmsgque")) {
40 MqFactoryCT<MqContextC>::Add("ccmqmsgque")->Default()->Initial();
41 }
42
43 // update the basic-types
44 // BEGIN-MqMsgque-self - created by 'cc_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
45
55
56 // END-MqMsgque-self - created by 'cc_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
57 }
58
60
64
65 // doc-key: MqMsgque,MqMsgque-Setup,sm_
66
73 #define MqCleanupTmpl() CcMqCleanup()
74
82 #define MqSetupTmpl() CcMqSetup()
83
85 // MqMsgque_Setup_CC_API
86
87 // BEGIN-MqMsgque - created by 'cc_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
88
92
93 // doc-key: MqMsgque,MqMsgque-Setup,sm_
94
100
104 MqSetupTmpl();
105 }
106
108 // MqMsgque_Setup_CC_API
109
110 // END-MqMsgque - created by 'cc_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
111
112 // BEGIN-MqMsgque-null - created by 'cc_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
113
114 thread_local MqFactoryC MqFactoryC::MK_NULL_REF = {(MK_OBJ)0};
115 thread_local MqDumpC MqDumpC::MK_NULL_REF = {(MK_OBJ)0};
116 thread_local MqContextC MqContextC::MK_NULL_REF = {(MK_OBJ)0};
117
118 // END-MqMsgque-null - created by 'cc_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
119
120 // *******************************************************************************************************
121 // MqContextC
122
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 }
157
160 ErrorCheck (MkBufferListCheckOptionI32 (reinterpret_cast<MQ_CTX>(hdl)->link.alfa, opt, 0, true, val));
161 }
162
163} // END - namespace "ccmqmsgque"
164
165#if defined(_MSC_VER)
166
167BOOL WINAPI DllMain(
168 HINSTANCE hModule,
169 DWORD ul_reason_for_call,
170 LPVOID lpReserved
171)
172{
173 switch (ul_reason_for_call)
174 {
175 case DLL_THREAD_ATTACH:
176 case DLL_THREAD_DETACH:
177 return FALSE;
178 case DLL_PROCESS_ATTACH:
180 break;
181 case DLL_PROCESS_DETACH:
183 break;
184 }
185 return TRUE;
186}
187#endif
#define MqRtSetup_NULL_RT
#define AllRtSetup_NULL
implements the ccmqmsgque API object: ConfigSetBgError
implements the ccmqmsgque API object: ConfigSetEvent
template wrapper for libmqmsgque::MqFactoryS
static MqFactoryCT< T > * Add(MK_STRN ident)
Add a new MqFactoryC identified by factory-identifier and defined by factory-constructor … → C-API...
data used to define a factory → C-API: libmqmsgque::MqFactoryS
implements the ccmqmsgque API object: ConfigSetServerCleanup
implements the ccmqmsgque API object: ConfigSetServerSetup
#define MkBufferListCheckOptionI32(...)
signed int MK_I32
const MK_STRB * MK_STRN
void ErrorCheck(enum MkErrorE err, MK_STRN const caller=__builtin_FUNCTION(), MK_I32 const line=__builtin_LINE()) const
struct MkObjectS * MK_OBJ
size_t MkRuntimeCallbackAdd(MK_RT mkrt, MkRuntimeCallbackS *cbdata, MkRuntimeInitF rt_callback, MK_STRN ident)
#define MK_RT_CALL
#define MkRtSetup_X(x)
void MkRuntimeCallbackDel(MK_RT mkrt, MkRuntimeCallbackS *cbdata)
#define MkRtSetup_NULL
#define MK_RT_ARGS_ONLY
static void MqContextC_selfUnlink(MK_RT_ARGS MK_PTR self, MK_PTR env)
static void MqContextC_selfDelete(MK_RT_ARGS MK_PTR self, MK_PTR env)
void Init(MK_STRN caller=__builtin_FUNCTION())
static thread_local MqContextC MK_NULL_REF
static MK_PTR MqContextC_selfCreate(MK_RT_ARGS MK_OBJ obj, MK_PTR const env)
#define MqContextC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MqConfigSetBgError(...)
#define MqConfigSetServerSetup(...)
#define MqConfigSetServerCleanup(...)
#define MqConfigSetEvent(...)
static void MqDumpC_selfUnlink(MK_RT_ARGS MK_PTR self, MK_PTR env)
Definition MqDumpC_cc.hh:54
static thread_local MqDumpC MK_NULL_REF
Definition MqDumpC_cc.hh:34
static MK_PTR MqDumpC_selfCreate(MK_RT_ARGS MK_OBJ obj, MK_PTR const env)
Definition MqDumpC_cc.hh:45
static void MqDumpC_selfDelete(MK_RT_ARGS MK_PTR self, MK_PTR env)
Definition MqDumpC_cc.hh:50
#define MqDumpC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static void MqFactoryC_selfUnlink(MK_RT_ARGS MK_PTR self, MK_PTR env)
static MK_PTR MqFactoryC_selfCreate(MK_RT_ARGS MK_OBJ obj, MK_PTR const env)
static void MqFactoryC_selfDelete(MK_RT_ARGS MK_PTR self, MK_PTR env)
static thread_local MqFactoryC MK_NULL_REF
#define MqFactoryC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static void mq_static_init_callback(MK_RT mkrt)
#define MqCleanupTmpl()
#define MqSetupTmpl()
static void Cleanup()
C++: [static] MqMsgque::Cleanup() → C-API cleanup ccmqmsgque internal memory …
static void Setup()
C++: [static] MqMsgque::Setup() → C-API setup ccmqmsgque internal memory …
static void CcMqCleanup()
C++: [static] MqMsgque::Setup() → C-API setup ccmqmsgque internal memory …
static void CcMqSetup()
C++: [static] MqMsgque::Setup() → C-API setup ccmqmsgque internal memory …
void MqCleanup(void)
cleanup ccmqmsgque internal memory …
void MqSetup(void)
setup ccmqmsgque internal memory …
namespace for the CcMqMsgque "C++"-API
static MkRuntimeCallbackS sMqRuntimeCallback
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
PUBLIC data structure for the ccmqmsgque-specific-data