theLink 10.0
Loading...
Searching...
No Matches
MqDumpC_py.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "MqDumpC_py.c"
12
14
15// PY class
16#define OT_CLASS (&NS(MqDumpCR))
17#define OT_CLASS_NAME "MqDumpC"
18
19#define OT_LNG2META(O) MqDmp(VAL2MNG(O))
20
21#define OT_retObj_CONSTR(mng) OT_retObj_SET(NS(MqDumpC_CTOR)(MK_RT_CALL (PyTypeObject*)class,mng))
22
23#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(MqDumpC)
24#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(MqDumpC)
25#define OT_SETUP_hdl_constr MK_RT_UNUSED AllRtSetup_NULL; \
26 MQ_DMP hdl = (MQ_DMP) OT_CLASS;
27#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(MqDumpC)
28#define OT_SETUP_hdl_static MK_RT_UNUSED AllRtSetup_NULL; \
29 __attribute__((unused)) MK_TYP hdl = MqDumpC##_TT;
30
31#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
32
33#if !defined(SetupRtFromObj_X)
34 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
35 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
36#endif
37
38// MO class
39#undef MqDumpCTT
40#define MqDumpCTT MQ(MqMsgqueThreadState).MqDumpCTT
41/* MqDumpC_MK_NULL defined in LibMqMsgque_py.h */
42
43__attribute__((unused)) mk_inline
44OT_OBJ_T NS(MqDumpC_CTOR) (MK_RT_ARGS OT_CLS_T type, MQ_DMP hdl) {
45 return MK(AtomCreate)(MK_RT_CALL type,MqDumpC_X2obj(hdl));
46}
47
48// helper: mk_dbg_color_ln(MK_COLOR_YELLOW,"hdl<%p>, self<%p>", obj, self);
49
50// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
51static MK_PTR NS(MqDumpC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
52 return MK(AtomCreate) (MK_RT_CALL OT_CLASS,obj);
53}
54// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
55static void NS(MqDumpC_selfDelete) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
56 MK(AtomDeleteHard) (MK_RT_CALL OT_SELF);
57}
58// META: called to destroy link from SELF to META
59static void NS(MqDumpC_selfUnlink) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
60 MkObjectC_Obj *selfO = (MkObjectC_Obj*) self;
61 selfO->hdl = NULL;
62}
63
64// initialize the PY and MO class specific object
65#define ClassInit \
66 /* if not already done, initialize NEW META type */ \
67 if (MqDumpCTT == NULL) MqDumpCTT = MqDumpSTT; \
68 \
69 /* protect against double call */ \
70 if (MqDumpCTT->selfCreate == NS(MqDumpC_selfCreate)) return MK_OK; \
71 \
72 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
73 MqDumpCTT->selfCreate = NS(MqDumpC_selfCreate); \
74 MqDumpCTT->selfDelete = NS(MqDumpC_selfDelete); \
75 MqDumpCTT->selfUnlink = NS(MqDumpC_selfUnlink); \
76 \
77 if (!PyType_HasFeature(OT_CLASS,Py_TPFLAGS_READY)) { \
78 NS(MqDumpCR).tp_base = MqDumpC_base; \
79 OtErrorCheckLng (PyType_Ready(OT_CLASS)); \
80 } \
81 OtErrorCheckLng(PyModule_AddObjectRef(m, "MqDumpC", (PyObject *)OT_CLASS)); \
82 \
83 /* define the "NULL" object */ \
84 MqDumpC_MK_NULL = Py_NewRef(MK(AtomCreate) (MK_RT_CALL OT_CLASS, NULL /*obj*/));
85
86/* LABEL-END */
87
93
94// BEGIN-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
95
96// doc-key: MqDumpC,MqDump,sCi,func
97#define Error_doc "MqDumpC MqDumpC.Error(error:MqContextC, ?dumpP_inout:MqDumpC=None?)"
98#define Export_doc "MqDumpC MqDumpC.Export(ctx:MqContextC, ?dumpP_inout:MqDumpC=None?)"
99#define new_doc "MqDumpC MqDumpC.new(ctx:MqContextC, ?dumpP_inout:MqDumpC=None?)"
100
101// doc-key: MqDumpC,MqDump,sCo,func
102#define BinSet_doc "MqDumpC MqDumpC.BinSet(data:binary)"
103
104// doc-key: MqDumpC,MqDump,sc_,func
105#define GetNull_doc "MqDumpC MqDumpC.GetNull()"
106#define HandleResolve_doc "MqDumpC MqDumpC.HandleResolve(netHdl:MK_HDL)"
107#define Instances_doc "MqDumpC MqDumpC.Instances()"
108
109// doc-key: MqDumpC,MqDump,oc_,func
110#define Next_doc "MqDumpC dmp.Next()"
111#define Prev_doc "MqDumpC dmp.Prev()"
112
113// doc-key: MqDumpC,MqDump,om_,func
114#define BinGet_doc "binary dump.BinGet() (const)"
115// skip class-overload: HandleGet → MkObjectHandleGet
116#define Import_doc "dump.Import(ctx:MqContextC)"
117// skip class-overload: Log → MkObjectLog
118#define SizeGet_doc "long dump.SizeGet() (const)"
119#define TokenGet_doc "string dump.TokenGet() (const)"
120
121// END-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
122
128
129// BEGIN-MqDumpC - created by 'py_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
130
134
135// doc-key: MqDumpC,MqDumpC-Class-Export,sc_
136
138static OT_ProcRet NS(MqDumpC_HandleResolve) (OtClass_ARGS) {
141 MK_HDL netHdl = 0;
144 MQ_DMP retVal = MqDumpHandleResolve (netHdl);
145 OT_retObj_SET_DMP(retVal);
146 goto end;
147 error:
149 end:
151}
152
153// doc-key: MqDumpC,MqDumpC-Class-Export,om_
154
155// skip on class-overload: MqDumpHandleGet → MkObjectHandleGet
157static OT_ProcRet NS(MqDumpC_HandleGet) (MqDumpC_ARGS) {OT_ERROR_LNG_RETURN;}
158
160// MqDumpC_Class_PY_API
161
165
166// doc-key: MqDumpC,MqDumpC-Class-Introspection,oc_
167
169static OT_ProcRet NS(MqDumpC_Next) (MqDumpC_ARGS) {
173 MQ_DMP retVal = MqDumpNext (hdl);
174 OT_retObj_SET_DMP(retVal);
175 goto end;
176 error:
178 end:
180}
181
183static OT_ProcRet NS(MqDumpC_Prev) (MqDumpC_ARGS) {
187 MQ_DMP retVal = MqDumpPrev (hdl);
188 OT_retObj_SET_DMP(retVal);
189 goto end;
190 error:
192 end:
194}
195
196// doc-key: MqDumpC,MqDumpC-Class-Introspection,sc_
197
199static OT_ProcRet NS(MqDumpC_Instances) (OtClass_ARGS) {
203 MQ_DMP retVal = MqDumpInstances ();
204 OT_retObj_SET_DMP(retVal);
205 goto end;
206 error:
208 end:
210}
211
213// MqDumpC_Class_PY_API
214
218
219// doc-key: MqDumpC,MqDumpC-Class-Misc,sc_
220
222static OT_ProcRet NS(MqDumpC_GetNull) (OtClass_ARGS) {
226 MQ_DMP retVal = MqDumpGetNull ();
227 OT_retObj_SET_DMP(retVal);
228 goto end;
229 error:
231 end:
233}
234
236// MqDumpC_Class_PY_API
237
241
242// doc-key: MqDumpC,MqDumpC-Misc,om_
243
244// skip on class-overload: MqDumpLog → MkObjectLog
247
249static OT_ProcRet NS(MqDumpC_SizeGet) (MqDumpC_ARGS) {
254 goto end;
255 error:
257 end:
259}
260
262static OT_ProcRet NS(MqDumpC_TokenGet) (MqDumpC_ARGS) {
267 goto end;
268 error:
270 end:
272}
273
275// MqDumpC_Misc_PY_API
276
280
281// doc-key: MqDumpC,MqDumpC-TOR,sCi
282
284static OT_ProcRet NS(MqDumpC_Error) (OtClass_ARGS) {
287 MQ_CTX error = 0;
289 MQ_DMP dumpP_inout = NULL;
292 MkErrorC_Check(error,MqDumpError (error, &dumpP_inout));
293 OT_retObj_SET_DMP(dumpP_inout);
294 goto end;
295 error:
297 end:
299}
300
302static OT_ProcRet NS(MqDumpC_Export) (OtClass_ARGS) {
305 MQ_CTX ctx = 0;
307 MQ_DMP dumpP_inout = NULL;
310 MkErrorC_Check(ctx,MqDumpExport (ctx, &dumpP_inout));
311 OT_CONSTRUCTOR_POST(dumpP_inout)
312 OT_retObj_SET_DMP(dumpP_inout);
313 goto end;
314 error:
316 end:
318}
319
321static OT_ProcRet NS(MqDumpC_new) (CONSTR_ARGS) {
324 MQ_CTX ctx = 0;
326 MQ_DMP dumpP_inout = NULL;
328 MkErrorC_Check(ctx,MqDumpExport (ctx, &dumpP_inout));
329 OT_CONSTRUCTOR_POST(dumpP_inout)
330 OT_retObj_CONSTR(dumpP_inout);
331 goto end;
332 error:
334 end:
336}
337
338// doc-key: MqDumpC,MqDumpC-TOR,sCo
339
341static OT_ProcRet NS(MqDumpC_BinSet) (OtClass_ARGS) {
344 MkBinaryR data = {0};
347 MQ_DMP dmp_out;
349 OT_retObj_SET_DMP(dmp_out);
350 goto end;
351 error:
353 end:
355}
356
357// doc-key: MqDumpC,MqDumpC-TOR,om_
358
360static OT_ProcRet NS(MqDumpC_BinGet) (MqDumpC_ARGS) {
364 MkBinaryR retVal = MqDumpBinGet (hdl);
366 goto end;
367 error:
369 end:
371}
372
374static OT_ProcRet NS(MqDumpC_Import) (MqDumpC_ARGS) {
377 MQ_CTX ctx = 0;
380 MkErrorC_Check(hdl,MqDumpImport (hdl, ctx));
382 goto end;
383 error:
385 end:
387}
388
390// MqDumpC_TOR_PY_API
391
392// END-MqDumpC - created by 'py_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
393
399
400static PyMethodDef NS(MqDumpC_Methods)[] = {
401
402 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
403
404 // doc-key: MqDumpC,MqDump,sCi
405 { "Error" , (PyCFunction) NS(MqDumpC_Error) , METH_VARARGS|METH_CLASS , Error_doc },
406 { "Export" , (PyCFunction) NS(MqDumpC_Export) , METH_VARARGS|METH_CLASS , Export_doc },
407
408 // doc-key: MqDumpC,MqDump,sCo
409 { "BinSet" , (PyCFunction) NS(MqDumpC_BinSet) , METH_O|METH_CLASS , BinSet_doc },
410
411 // doc-key: MqDumpC,MqDump,sc_
412 { "GetNull" , (PyCFunction) NS(MqDumpC_GetNull) , METH_NOARGS|METH_CLASS , GetNull_doc },
413 { "HandleResolve" , (PyCFunction) NS(MqDumpC_HandleResolve) , METH_O|METH_CLASS , HandleResolve_doc },
414 { "Instances" , (PyCFunction) NS(MqDumpC_Instances) , METH_NOARGS|METH_CLASS , Instances_doc },
415
416 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
417
418 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
419
420 // doc-key: MqDumpC,MqDump,oc_
421 { "Next" , (PyCFunction) NS(MqDumpC_Next) , METH_NOARGS , Next_doc },
422 { "Prev" , (PyCFunction) NS(MqDumpC_Prev) , METH_NOARGS , Prev_doc },
423
424 // doc-key: MqDumpC,MqDump,om_
425 { "BinGet" , (PyCFunction) NS(MqDumpC_BinGet) , METH_NOARGS , BinGet_doc },
426 // skip class-overload: MqDumpHandleGet → HandleGet, NS(MqDumpC_HandleGet)
427 { "Import" , (PyCFunction) NS(MqDumpC_Import) , METH_O , Import_doc },
428 // skip class-overload: MqDumpLog → Log, NS(MqDumpC_Log)
429 { "SizeGet" , (PyCFunction) NS(MqDumpC_SizeGet) , METH_NOARGS , SizeGet_doc },
430 { "TokenGet" , (PyCFunction) NS(MqDumpC_TokenGet) , METH_NOARGS , TokenGet_doc },
431
432 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
433
434 {NULL, NULL, 0, NULL} /* Sentinel */
435};
436
437// OT_CLASS_TYPE_REF NS(MqDumpCR) = {0};
439 PyVarObject_HEAD_INIT(NULL, 0)
440 .tp_name = "pymqmsgque.MqDumpC",
441 .tp_doc = "PyMqMsgque MqDumpC Type",
442 .tp_basicsize = sizeof(MqDumpC_Obj),
443 .tp_itemsize = 0,
444 .tp_new = (newfunc) NS(MqDumpC_new),
445 .tp_methods = NS(MqDumpC_Methods),
446 .tp_flags = Py_TPFLAGS_DEFAULT,
447 .tp_base = NULL
448};
449
455
456int
457NS(pMqDumpC_Init)(MK_RT_ARGS OT_OBJ_T m) {
459
461
462 return 0;
463error:
464 return -1;
465}
466
467// vim: nowrap
#define OT_SELF
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_ERROR_LNG_RETURN
#define OT_retObj_SET_Error
#define OT_CONSTRUCTOR_POST(x)
#define OT_retObj_SET_LONG(nat)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
PyTypeObject * OT_CLS_T
#define OT_GET__ME_REF_MkBinaryR(b)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
PyObject * OT_OBJ_T
#define OT_CHECK__ME_REF_MkBinaryR(val)
#define OT_retObj_SET_STR(nat)
#define OT_CLASS_TYPE_REF
#define OT_CHECK_OPTIONAL(val)
#define OT_retObj_SET(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define CONSTR_ARGS
#define OtClass_ARGS
tag: nhi1-release-250425
struct MqDumpC_Obj MqDumpC_Obj
#define NS(n)
#define MqDumpC_ARGS
#define OT_retObj_SET_DMP(nat)
#define Instances_doc
Definition MqDumpC_py.c:107
#define Import_doc
Definition MqDumpC_py.c:116
#define OT_SETUP_hdl_static_constr
Definition MqDumpC_py.c:31
#define OT_SETUP_hdl
Definition MqDumpC_py.c:23
#define OT_retObj_CONSTR(mng)
Definition MqDumpC_py.c:21
#define GetNull_doc
Definition MqDumpC_py.c:105
#define Next_doc
Definition MqDumpC_py.c:110
#define Error_doc
Definition MqDumpC_py.c:97
#define HandleResolve_doc
Definition MqDumpC_py.c:106
#define Prev_doc
Definition MqDumpC_py.c:111
#define OT_CLASS
Definition MqDumpC_py.c:16
#define OT_SETUP_hdl_static
Definition MqDumpC_py.c:28
#define OT_SETUP_hdl_constr
Definition MqDumpC_py.c:25
#define Export_doc
Definition MqDumpC_py.c:98
#define SizeGet_doc
Definition MqDumpC_py.c:118
#define new_doc
Definition MqDumpC_py.c:99
#define TokenGet_doc
Definition MqDumpC_py.c:119
#define BinSet_doc
Definition MqDumpC_py.c:102
#define ClassInit
Definition MqDumpC_py.c:65
#define BinGet_doc
Definition MqDumpC_py.c:114
#define error
Definition high_lng.h:339
#define MK_ERROR_FORMAT
#define mk_inline
#define MK_NULL_NO
#define MK_NULL_YES
#define MK_UNUSED
#define MK_DEPRECATED
MK_PTRB * MK_PTR
int32_t MK_HDL
#define MK_RT_CALL
#define MK_RT_ARGS
#define MqDumpHandleResolve(...)
static MQ_DMP MqDumpGetNull(void)
Null-Slot - return a MqDumpC typed NULL instance …
#define MqDumpInstances()
static MQ_DMP MqDumpNext(MQ_DMP const dmp)
get next instance from linked-list of MqDumpS type
static MQ_DMP MqDumpPrev(MQ_DMP const dmp)
get previous instance from linked-list of MqDumpS type
#define MqDumpC_X2obj(x)
MK_STRN MqDumpTokenGet(MQ_DMPN const dump)
return the MqContextC_ServiceApi_Identifer …
MK_SIZE MqDumpSizeGet(MQ_DMPN const dump)
report the binary data size from an MqDumpS object
#define MqDumpError(...)
#define MqDumpExport(...)
#define MqDumpBinSet(...)
#define MqDumpImport(...)
MkBinaryR MqDumpBinGet(MQ_DMPN const dump)
export the binary data from an MqDumpS object
#define MQ_STATIC_RT
MK_OBJ const obj
Definition high_lng.h:136
#define OT_CHECK_NIH(val)
#define OT_CHECK_CTX(val, nullB)
#define OT_CHECK_DMP(val, nullB)
PyObject_HEAD MK_OBJ hdl
PUBLIC data structure for the pymqmsgque-specific-data
MqDumpC - the class known as dmp or dump is used to export a pymqmsgque data package as binary …