theLink 10.0
Loading...
Searching...
No Matches
MqFactoryC_rb.c File Reference

tag: nhi1-release-250425 More...

+ Include dependency graph for MqFactoryC_rb.c:

Go to the source code of this file.

Macros

#define SetupRtFromObj(hd)
 
#define META_FILE_NAME   "MqFactoryC_rb.c"
 
#define OT_CLASS   NS(MqFactoryC)
 
#define OT_CLASS_NAME   "MqFactoryC"
 
#define OT_LNG2META(O)
 
#define S_INIT   NS(sInit)(MK_RT_CALL_ONLY)
 
#define OT_SETUP_hdl   OT_SETUP_hdl_tmpl(MqFactoryC);
 
#define OT_SETUP_hdl__null_allow   OT_SETUP_hdl_tmpl__null_allow(MqFactoryC);
 
#define OT_SETUP_hdl_constr
 
#define OT_SETUP_hdl_destr   OT_SETUP_hdl_tmpl__null_allow(MqFactoryC);
 
#define OT_SETUP_hdl_static
 
#define OT_SETUP_hdl_static_constr   OT_SETUP_hdl_static
 
#define SetupRtFromObj_X(hdl)
 
#define SetupRtFromObj_XN(hdl)
 
#define Add_doc   "MqFactoryC MqFactoryC.Add(constructor:class, ?ident:string=\"MK_NULL\"?)"
 
#define new_doc   "MqFactoryC MqFactoryC.new(constructor:class, ?ident:string=\"MK_NULL\"?)"
 
#define Get_doc   "MqFactoryC MqFactoryC.Get(?ident:string=\"\"?)"
 
#define GetCalled_doc   "MqFactoryC MqFactoryC.GetCalled(?ident:string=\"\"?)"
 
#define GetCalledL_doc   "MqFactoryC MqFactoryC.GetCalledL(largs:MkBufferListC)"
 
#define GetNull_doc   "MqFactoryC MqFactoryC.GetNull()"
 
#define HandleResolve_doc   "MqFactoryC MqFactoryC.HandleResolve(netHdl:MK_HDL)"
 
#define Instances_doc   "MqFactoryC MqFactoryC.Instances()"
 
#define DefaultIdent_doc   "string MqFactoryC.DefaultIdent()"
 
#define InitialIdent_doc   "string MqFactoryC.InitialIdent()"
 
#define LogAll_doc   "MqFactoryC.LogAll(?callfunc:string=\"MK_NULL\"?)"
 
#define Dup2_doc   "MqFactoryC fct.Dup2(ident:string) (const)"
 
#define Default_doc   "MqFactoryC fct.Default()"
 
#define Initial_doc   "MqFactoryC fct.Initial()"
 
#define Next_doc   "MqFactoryC fct.Next()"
 
#define Prev_doc   "MqFactoryC fct.Prev()"
 
#define New_doc   "MqContextC fct.New()"
 
#define GetOriginalIdent_doc   "string fct.GetOriginalIdent() (const)"
 

Functions

static void rbmqmsgque_sMark (MK_PTR)
 
static OT_OBJ_T rbmqmsgque_LNG_CONSTR (OT_CLS_T clazz, MK_MNG mng, int objc, VALUE *objv)
 
static MK_PTR rbmqmsgque_MqFactoryC_selfCreate (MK_RT mkrt, MK_OBJ obj, MK_PTR envP)
 
static void rbmqmsgque_MqFactoryC_selfDelete (MK_RT mkrt, MK_PTR ptr, MK_PTR envP)
 
static void rbmqmsgque_MqFactoryC_selfUnlink (MK_RT mkrt, MK_PTR ptr, MK_PTR envP)
 
static void rbmqmsgque_sInit (MK_RT mkrt)
 
static VALUE rbmqmsgque_sFactoryCall (VALUE args)
 
static enum MkErrorE rbmqmsgque_sFactoryCTor (MQ_CALLBACK_FACTORY_CTOR_ARGS)
 
static void rbmqmsgque_sFactoryDTor (MK_RT mkrt, MQ_CTX mqctx, bool doFactoryDelete, MQ_FCT const fct)
 
static void rbmqmsgque_sFactoryDataFree (MK_RT mkrt, MK_PTR *dataP)
 
static void rbmqmsgque_sFactoryDataCopy (MK_RT mkrt, MK_PTR *dataP)
 
static OT_ProcRet rbmqmsgque_MqFactoryC_HandleResolve (OtClass_ARGS)
  Ruby: (static) MqFactoryC MqFactoryC.HandleResolve(netHdl:MK_HDL) C-API
Handle-Resolve-Slot - return a MqFactoryC from netHdl or nil if invalid…
 
MK_DEPRECATED static MK_UNUSED OT_ProcRet rbmqmsgque_MqFactoryC_HandleGet (MqFactoryC_ARGS)
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Next (MqFactoryC_ARGS)
  Ruby: MqFactoryC fct.Next() C-API
get next instance from linked-list of MqFactoryS type
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Prev (MqFactoryC_ARGS)
  Ruby: MqFactoryC fct.Prev() C-API
get previous instance from linked-list of MqFactoryS type
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Instances (OtClass_ARGS)
  Ruby: (static) MqFactoryC MqFactoryC.Instances() C-API
get head-instance from linked-list of MqFactoryS type …
 
static OT_ProcRet rbmqmsgque_MqFactoryC_GetNull (OtClass_ARGS)
  Ruby: (static) MqFactoryC MqFactoryC.GetNull() C-API
Null-Slot - return a MqFactoryC typed NULL instance …
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Get (OtClass_ARGS)
  Ruby: (static) MqFactoryC MqFactoryC.Get(?ident:string=""?) C-API
return the MqFactoryC
 
static OT_ProcRet rbmqmsgque_MqFactoryC_GetCalled (OtClass_ARGS)
  Ruby: (static) MqFactoryC MqFactoryC.GetCalled(?ident:string=""?) C-API
returns the MqFactoryC identified by ident
 
static OT_ProcRet rbmqmsgque_MqFactoryC_GetCalledL (OtClass_ARGS)
  Ruby: (static) MqFactoryC MqFactoryC.GetCalledL(largs:MkBufferListC) C-API
returns the MqFactoryC identified as first argument in the largs MkBufferListC
 
static OT_ProcRet rbmqmsgque_MqFactoryC_GetOriginalIdent (MqFactoryC_ARGS)
  Ruby: string fct.GetOriginalIdent() C-API
helper function to return MqFactoryS::originalIdent
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Default (MqFactoryC_ARGS)
  Ruby: MqFactoryC fct.Default() C-API
set the default-attribute to the factory
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Initial (MqFactoryC_ARGS)
  Ruby: MqFactoryC fct.Initial() C-API
set the initial-attribut to fct
 
static OT_ProcRet rbmqmsgque_MqFactoryC_New (MqFactoryC_ARGS)
  Ruby: MqContextC fct.New() C-API
create a new MqContextC from a MqFactoryC
 
MK_DEPRECATED static MK_UNUSED OT_ProcRet rbmqmsgque_MqFactoryC_Log (MqFactoryC_ARGS)
 
static OT_ProcRet rbmqmsgque_MqFactoryC_DefaultIdent (OtClass_ARGS)
  Ruby: (static) string MqFactoryC.DefaultIdent() C-API
return the factory-identifier of the default MqFactoryC
 
static OT_ProcRet rbmqmsgque_MqFactoryC_InitialIdent (OtClass_ARGS)
  Ruby: (static) string MqFactoryC.InitialIdent() C-API
return the factory-identifier of the initial MqFactoryC
 
static OT_ProcRet rbmqmsgque_MqFactoryC_LogAll (OtClass_ARGS)
  Ruby: (static) MqFactoryC.LogAll(?callfunc:string="MK_NULL"?) C-API
log all "factories" to stderr
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Dup2 (MqFactoryC_ARGS)
  Ruby: (constructor) MqFactoryC fct.Dup2(ident:string) C-API
create a duplicate of the singleton object MqFactoryC using a new factory-identifer
 
static OT_ProcRet rbmqmsgque_MqFactoryC_Add (OtClass_ARGS)
  Ruby: (constructor,static) MqFactoryC MqFactoryC.Add(constructor:class, ?ident:string="MK_NULL"?) C-API
Add a new MqFactoryC identified by factory-identifier and defined by factory-constructor
 
static OT_ProcRet rbmqmsgque_MqFactoryC_new (CONSTR_ARGS)
  Ruby: (constructor,static) MqFactoryC MqFactoryC.new(constructor:class, ?ident:string="MK_NULL"?) C-API
Add a new MqFactoryC identified by factory-identifier and defined by factory-constructor
 
void rbmqmsgque_MqFactoryC_Init (MK_RT mkrt, MQ_RT mqrt)
 

Variables

OT_CLS_T OT_CLASS
 
static MK_TYP MqFactoryCTT = NULL
 
OT_OBJ_T rbmqmsgque_MqFactoryC_MK_NULL = 0
 
static rb_data_type_t rbmqmsgque_MqFactoryC_T
 
static ID rbmqmsgque_id_new
 

Detailed Description

tag: nhi1-release-250425

Definition in file MqFactoryC_rb.c.

Macro Definition Documentation

◆ Add_doc

#define Add_doc   "MqFactoryC MqFactoryC.Add(constructor:class, ?ident:string=\"MK_NULL\"?)"

doc definition

Definition at line 117 of file MqFactoryC_rb.c.

◆ Default_doc

#define Default_doc   "MqFactoryC fct.Default()"

Definition at line 137 of file MqFactoryC_rb.c.

◆ DefaultIdent_doc

#define DefaultIdent_doc   "string MqFactoryC.DefaultIdent()"

Definition at line 129 of file MqFactoryC_rb.c.

◆ Dup2_doc

#define Dup2_doc   "MqFactoryC fct.Dup2(ident:string) (const)"

Definition at line 134 of file MqFactoryC_rb.c.

◆ Get_doc

#define Get_doc   "MqFactoryC MqFactoryC.Get(?ident:string=\"\"?)"

Definition at line 121 of file MqFactoryC_rb.c.

◆ GetCalled_doc

#define GetCalled_doc   "MqFactoryC MqFactoryC.GetCalled(?ident:string=\"\"?)"

Definition at line 122 of file MqFactoryC_rb.c.

◆ GetCalledL_doc

#define GetCalledL_doc   "MqFactoryC MqFactoryC.GetCalledL(largs:MkBufferListC)"

Definition at line 123 of file MqFactoryC_rb.c.

◆ GetNull_doc

#define GetNull_doc   "MqFactoryC MqFactoryC.GetNull()"

Definition at line 124 of file MqFactoryC_rb.c.

◆ GetOriginalIdent_doc

#define GetOriginalIdent_doc   "string fct.GetOriginalIdent() (const)"

Definition at line 146 of file MqFactoryC_rb.c.

◆ HandleResolve_doc

#define HandleResolve_doc   "MqFactoryC MqFactoryC.HandleResolve(netHdl:MK_HDL)"

Definition at line 125 of file MqFactoryC_rb.c.

◆ Initial_doc

#define Initial_doc   "MqFactoryC fct.Initial()"

Definition at line 138 of file MqFactoryC_rb.c.

◆ InitialIdent_doc

#define InitialIdent_doc   "string MqFactoryC.InitialIdent()"

Definition at line 130 of file MqFactoryC_rb.c.

◆ Instances_doc

#define Instances_doc   "MqFactoryC MqFactoryC.Instances()"

Definition at line 126 of file MqFactoryC_rb.c.

◆ LogAll_doc

#define LogAll_doc   "MqFactoryC.LogAll(?callfunc:string=\"MK_NULL\"?)"

Definition at line 131 of file MqFactoryC_rb.c.

◆ META_FILE_NAME

#define META_FILE_NAME   "MqFactoryC_rb.c"

Definition at line 14 of file MqFactoryC_rb.c.

◆ New_doc

#define New_doc   "MqContextC fct.New()"

Definition at line 143 of file MqFactoryC_rb.c.

◆ new_doc

#define new_doc   "MqFactoryC MqFactoryC.new(constructor:class, ?ident:string=\"MK_NULL\"?)"

Definition at line 118 of file MqFactoryC_rb.c.

◆ Next_doc

#define Next_doc   "MqFactoryC fct.Next()"

Definition at line 139 of file MqFactoryC_rb.c.

◆ OT_CLASS

#define OT_CLASS   NS(MqFactoryC)

Definition at line 18 of file MqFactoryC_rb.c.

◆ OT_CLASS_NAME

#define OT_CLASS_NAME   "MqFactoryC"

Definition at line 19 of file MqFactoryC_rb.c.

◆ OT_LNG2META

#define OT_LNG2META ( O)
Value:
#define VAL2MNG(val)
static MQ_FCT MqFct(MK_MNG mng)
cast a unknown-object into an MqFactoryS pointer or NULL if not possible

Definition at line 21 of file MqFactoryC_rb.c.

◆ OT_SETUP_hdl

#define OT_SETUP_hdl   OT_SETUP_hdl_tmpl(MqFactoryC);

Definition at line 91 of file MqFactoryC_rb.c.

◆ OT_SETUP_hdl__null_allow

#define OT_SETUP_hdl__null_allow   OT_SETUP_hdl_tmpl__null_allow(MqFactoryC);

Definition at line 92 of file MqFactoryC_rb.c.

◆ OT_SETUP_hdl_constr

#define OT_SETUP_hdl_constr
Value:
OT_OBJ_T clazz = self; \
#define OT_OBJ_T
#define AllRtSetup_NULL
#define MkERROR
#define MqFactoryC_type
same as MqFactoryS but useable in a class-macro as: class##_type …

Definition at line 93 of file MqFactoryC_rb.c.

93#define OT_SETUP_hdl_constr AllRtSetup_NULL; \
94 OT_OBJ_T clazz = self; \
95 MqFactoryC_type hdl = (MqFactoryC_type) &MkERROR;

◆ OT_SETUP_hdl_destr

#define OT_SETUP_hdl_destr   OT_SETUP_hdl_tmpl__null_allow(MqFactoryC);

Definition at line 96 of file MqFactoryC_rb.c.

◆ OT_SETUP_hdl_static

#define OT_SETUP_hdl_static
Value:
__attribute__((unused)) MK_TYP hdl = MqFactoryC##_TT;

Definition at line 97 of file MqFactoryC_rb.c.

97#define OT_SETUP_hdl_static AllRtSetup_NULL; \
98 __attribute__((unused)) MK_TYP hdl = MqFactoryC##_TT;

◆ OT_SETUP_hdl_static_constr

#define OT_SETUP_hdl_static_constr   OT_SETUP_hdl_static

Definition at line 99 of file MqFactoryC_rb.c.

◆ Prev_doc

#define Prev_doc   "MqFactoryC fct.Prev()"

Definition at line 140 of file MqFactoryC_rb.c.

◆ S_INIT

#define S_INIT   NS(sInit)(MK_RT_CALL_ONLY)

Definition at line 73 of file MqFactoryC_rb.c.

◆ SetupRtFromObj

#define SetupRtFromObj ( hd)
Value:

Definition at line 11 of file MqFactoryC_rb.c.

◆ SetupRtFromObj_X

#define SetupRtFromObj_X ( hdl)
Value:
#define AllRtSetup_X(x)

Definition at line 102 of file MqFactoryC_rb.c.

◆ SetupRtFromObj_XN

#define SetupRtFromObj_XN ( hdl)
Value:
#define AllRtSetup_XN(x)

Definition at line 103 of file MqFactoryC_rb.c.

Function Documentation

◆ rbmqmsgque_LNG_CONSTR()

static OT_OBJ_T rbmqmsgque_LNG_CONSTR ( OT_CLS_T clazz,
MK_MNG mng,
int objc,
VALUE * objv )
inlinestatic

Definition at line 50 of file MqFactoryC_rb.c.

50 {
51 return MK(AtomObjCrt)(clazz,&NS(MqFactoryC_T),mng,objc,objv);
52}
#define MK(n)
#define NS(n)
#define MqFactoryC_T
class as MkTypeDefS-class-type, useable in a class-macro as: class##_T …

◆ rbmqmsgque_MqFactoryC_Init()

void rbmqmsgque_MqFactoryC_Init ( MK_RT mkrt,
MQ_RT mqrt )

Definition at line 592 of file MqFactoryC_rb.c.

592 {
593
594 // init type
596 S_INIT;
597
598 // BEGIN-CLASS - created by 'rb_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
599
600 // doc-key: MqFactoryC,MqFactory,sCc
601 OT_METH_S ( MqFactoryC, Add, MqFactoryC_Add )
602 OT_METH_C ( MqFactoryC, new, MqFactoryC_new )
603
604 // doc-key: MqFactoryC,MqFactory,sc_
605 OT_METH_O ( MqFactoryC, Get, MqFactoryC_Get )
606 OT_METH_S ( MqFactoryC, Get, MqFactoryC_Get )
607 OT_METH_O ( MqFactoryC, GetCalled, MqFactoryC_GetCalled )
608 OT_METH_S ( MqFactoryC, GetCalled, MqFactoryC_GetCalled )
609 OT_METH_O ( MqFactoryC, GetCalledL, MqFactoryC_GetCalledL )
610 OT_METH_S ( MqFactoryC, GetCalledL, MqFactoryC_GetCalledL )
611 OT_METH_O ( MqFactoryC, GetNull, MqFactoryC_GetNull )
612 OT_METH_S ( MqFactoryC, GetNull, MqFactoryC_GetNull )
613 OT_METH_O ( MqFactoryC, HandleResolve, MqFactoryC_HandleResolve )
614 OT_METH_S ( MqFactoryC, HandleResolve, MqFactoryC_HandleResolve )
615 OT_METH_O ( MqFactoryC, Instances, MqFactoryC_Instances )
616 OT_METH_S ( MqFactoryC, Instances, MqFactoryC_Instances )
617
618 // doc-key: MqFactoryC,MqFactory,sm_
619 OT_METH_O ( MqFactoryC, DefaultIdent, MqFactoryC_DefaultIdent )
620 OT_METH_S ( MqFactoryC, DefaultIdent, MqFactoryC_DefaultIdent )
621 OT_METH_O ( MqFactoryC, InitialIdent, MqFactoryC_InitialIdent )
622 OT_METH_S ( MqFactoryC, InitialIdent, MqFactoryC_InitialIdent )
623 OT_METH_O ( MqFactoryC, LogAll, MqFactoryC_LogAll )
624 OT_METH_S ( MqFactoryC, LogAll, MqFactoryC_LogAll )
625
626 // END-CLASS - created by 'rb_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
627
628 // BEGIN-OBJ - created by 'rb_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
629
630 // doc-key: MqFactoryC,MqFactory,oCx
631 OT_METH_O ( MqFactoryC, Dup2, MqFactoryC_Dup2 )
632
633 // doc-key: MqFactoryC,MqFactory,oc_
634 OT_METH_O ( MqFactoryC, Default, MqFactoryC_Default )
635 OT_METH_O ( MqFactoryC, Initial, MqFactoryC_Initial )
636 OT_METH_O ( MqFactoryC, Next, MqFactoryC_Next )
637 OT_METH_O ( MqFactoryC, Prev, MqFactoryC_Prev )
638
639 // doc-key: MqFactoryC,MqFactory,oco
640 OT_METH_O ( MqFactoryC, New, MqFactoryC_New )
641
642 // doc-key: MqFactoryC,MqFactory,om_
643 OT_METH_O ( MqFactoryC, GetOriginalIdent, MqFactoryC_GetOriginalIdent )
644 // skip class-overload: MqFactoryHandleGet → HandleGet, MqFactoryC_HandleGet
645 // skip class-overload: MqFactoryLog → Log, MqFactoryC_Log
646
647 // END-OBJ - created by 'rb_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
648
649 // setup default factory… required for objects created WITHOUT factory
650 // example: Filter3.rb
651 if (!strcmp(MqFactoryDefaultIdent(), "libmqmsgque")) {
652
653 if ( MqFactoryDefault(
655 MqFactoryAdd (NULL,
656 NS(sFactoryCTor), (MK_PTR)NS(MqContextC), NULL, NULL,
657 NS(sFactoryDTor), NULL, NULL, NULL,
658 "rbmsgque"
659 )
660 )
661 ) == NULL
662 )
663 {
664 OT_ERROR_RUNTIME("MqFactoryC", "create default factory failed")
665 }
666 }
667
668 NS(id_new) = rb_intern("new");
669}
#define OT_ERROR_RUNTIME(clazz, str)
#define OT_METH_S(c, s, f)
#define OT_METH_O(c, s, f)
#define OT_METH_C(c, s, f)
#define S_INIT
static MK_TYP MqFactoryCTT
MK_PTRB * MK_PTR
#define MqFactoryC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MqFactoryInitial(...)
#define MqFactoryDefaultIdent()
#define MqFactoryDefault(...)
#define MqFactoryAdd(...)

◆ rbmqmsgque_MqFactoryC_selfCreate()

static MK_PTR rbmqmsgque_MqFactoryC_selfCreate ( MK_RT mkrt,
MK_OBJ obj,
MK_PTR envP )
static

Definition at line 59 of file MqFactoryC_rb.c.

59 {
60 OT_OBJ_T self = NS(LNG_CONSTR) (OT_CLASS, obj, 0, NULL);
61 return VAL2PTR(self);
62}
#define VAL2PTR(val)
#define OT_CLASS
MK_OBJ const obj
Definition high_lng.h:136

◆ rbmqmsgque_MqFactoryC_selfDelete()

static void rbmqmsgque_MqFactoryC_selfDelete ( MK_RT mkrt,
MK_PTR ptr,
MK_PTR envP )
static

Definition at line 64 of file MqFactoryC_rb.c.

64 {
66}
#define PTR2VAL(nat)
#define OT_OBJECT_DELETE_HARD(obj)
MK_STRN ptr
Definition high_lng.h:130

◆ rbmqmsgque_MqFactoryC_selfUnlink()

static void rbmqmsgque_MqFactoryC_selfUnlink ( MK_RT mkrt,
MK_PTR ptr,
MK_PTR envP )
static

Definition at line 68 of file MqFactoryC_rb.c.

68 {
69 OT_OBJ_T self = PTR2VAL(ptr);
70 RDATA(self)->data = NULL;
71}

◆ rbmqmsgque_sFactoryCall()

static VALUE rbmqmsgque_sFactoryCall ( VALUE args)
static

Definition at line 160 of file MqFactoryC_rb.c.

160 {
161 const VALUE *argsP = rb_array_const_ptr(args);
162 // return MK(OtNewInstanceWithOneArg)(argsP[0],argsP[1]);
163 return rb_funcall(argsP[0], NS(id_new), 1, argsP[1]);
164}

◆ rbmqmsgque_sFactoryCTor()

static enum MkErrorE rbmqmsgque_sFactoryCTor ( MQ_CALLBACK_FACTORY_CTOR_ARGS )
static

Definition at line 167 of file MqFactoryC_rb.c.

168{
169 MQ_CTX mqctx = NULL;
170 VALUE args;
171 VALUE tmplO;
172 VALUE self;
173 VALUE class;
174
175//printXV(tmpl, "RUBY: Factory[%s] -> %s\n", MqFactoryGetOriginalIdent(fct), MqLogFactoryE(create))
176
177 // setup tmpl
178 tmplO = CTX2VAL(tmpl);
179
180 // a child use the class of the "parent" and NOT the class from the "factory"
181 if (create & (MQ_FACTORY_NEW_CHILD)) {
182 class = CLASS_OF(tmplO);
183 } else {
184 class = PTR2VAL(fct->fct_ctor.data);
185 }
186
187 // call "new"
188 args = rb_ary_new3(2, class, tmplO);
189 int status;
190 self = rb_protect(NS(sFactoryCall), args, &status);
191 if (status) {
192 MK(MkExceptionC_Catch) (OT_Prefix_CALL NULL, NULL, __func__, "ProcessEvent");
193 }
194 rb_ary_free(args);
195
196 if (NIL_P(self) || MkErrorCheckE_0E() ) {
197 // special: RUBY does NOT call the destructor of a "broken" instance, this create a "left-over"
198 // MkRuntimeS::cid (not bad but different from other languages)
199 // set at: MqContextInit->MQ_RT_REF.cid = context
200 MkRuntimeSetCID(NULL);
201 goto error;
202 }
203 mqctx = VAL2CTX(self);
204
205 if (create & (MQ_FACTORY_NEW_CHILD)) {
206 MqSetupDup(mqctx, tmpl);
207 }
208
209 // a MQ_FACTORY_NEW_FILTER has "mqctx->obj.self" as ONLY reference… incr "refCnt"
210 // related to "NS(sFactoryDTor)→MQ_FACTORY_NEW_INIT→DECR_REG"
211 if (create & MQ_FACTORY_NEW_FILTER) {
212 INCR_REF((VALUE*)(&mqctx->super.obj.self));
213 }
214
215 // ruby-special: default event handler has !no! data and calling just the
216 // ruby-event-update function. CHILD does not need to call it too
217 if (create & MQ_FACTORY_NEW_CHILD && mqctx->setup.Event.data == NULL) {
218 mqctx->setup.Event.fCall = NULL;
219 }
220
221 *contextP = mqctx;
222 return MK_OK;
223
224error:
225 *contextP = NULL;
226 return MkErrorStack_0E();
227}
#define OT_Prefix_CALL
#define INCR_REF(valP)
#define CTX2VAL(nat)
#define VAL2CTX(val)
#define mqctx
#define MkErrorStack_0E()
MK_OK
void MkRuntimeSetCID(MK_OBJ const cid)
#define MqSetupDup(...)
@ MQ_FACTORY_NEW_FILTER
create object as a filter
@ MQ_FACTORY_NEW_CHILD
create object as a child of an other object
goto error
Definition high_lng.h:251
PUBLIC data structure for the rbmqmsgque-specific-data

◆ rbmqmsgque_sFactoryDataCopy()

static void rbmqmsgque_sFactoryDataCopy ( MK_RT mkrt,
MK_PTR * dataP )
static

Definition at line 256 of file MqFactoryC_rb.c.

256 {
257 if (*dataP != NULL) {
258 INCR_REF((VALUE*)dataP); // THREAD → no DEEP copy
259 }
260}

◆ rbmqmsgque_sFactoryDataFree()

static void rbmqmsgque_sFactoryDataFree ( MK_RT mkrt,
MK_PTR * dataP )
static

Definition at line 247 of file MqFactoryC_rb.c.

247 {
248 if (*dataP != NULL) {
249 /* I have NOT found any RUBY function to check if VM is still active !!
250 DECR_REF((VALUE*)dataP);
251 */
252 }
253 *dataP = NULL;
254}

◆ rbmqmsgque_sFactoryDTor()

static void rbmqmsgque_sFactoryDTor ( MK_RT mkrt,
MQ_CTX mqctx,
bool doFactoryDelete,
MQ_FCT const fct )
static

Definition at line 230 of file MqFactoryC_rb.c.

236{
237 // related to "NS(sFactoryCTor)→MQ_FACTORY_NEW_INIT→INCR_REG"
238 if (doFactoryDelete && mqctx->setup.factoryCall == MQ_FACTORY_NEW_FILTER) {
239 // DECR_REG does NOT call the destructor… just delete the "reference"
240 DECR_REF ((VALUE*)(&mqctx->super.obj.self));
241 }
242
243 // delete final -> only if not already done
245}
#define DECR_REF(valP)
#define MqContextDelete(x)

◆ rbmqmsgque_sInit()

static void rbmqmsgque_sInit ( MK_RT mkrt)
static

Definition at line 74 of file MqFactoryC_rb.c.

74 {
75
76 // add "selfCreate" and "selfDelete" feature to the MQ-MqFactoryC-Type
77 MqFactoryCTT->selfCreate = NS(MqFactoryC_selfCreate);
78 MqFactoryCTT->selfDelete = NS(MqFactoryC_selfDelete);
79 MqFactoryCTT->selfUnlink = NS(MqFactoryC_selfUnlink);
80
81 // create the RUBY class
82 OT_CLASS = rb_define_class_under(OT_PKG, "MqFactoryC", MK_BASE_CLASS);
83 rb_undef_alloc_func(OT_CLASS);
84
85 /* define the "NULL" object */
86 VALUE nullO = TypedData_Wrap_Struct (OT_CLASS, &NS(MqFactoryC_T), MK_NULL);
87 NS(MqFactoryC_MK_NULL) = nullO;
89}
#define MK_BASE_CLASS
#define OT_PKG
#define MqFactoryC_MK_NULL
#define MK_NULL
MkSelfUnlinkF selfUnlink
MkSelfDeleteF selfDelete
MkSelfCreateF selfCreate

◆ rbmqmsgque_sMark()

static void rbmqmsgque_sMark ( MK_PTR mng)
static

Definition at line 584 of file MqFactoryC_rb.c.

585{
586 MQ_FCT fct = MqFct(mng);
587 if (fct == NULL) return;
588 if (fct->fct_ctor.data) rb_gc_mark((VALUE)fct->fct_ctor.data);
589 if (fct->fct_dtor.data) rb_gc_mark((VALUE)fct->fct_dtor.data);
590}
MK_PTR data
additional data pointer for the fCall
MK_PTR data
additional data pointer for the fCall
data used to define a factory
struct MqFactoryDTorS fct_dtor
instance destructor interface
struct MqFactoryCTorS fct_ctor
instance constructor interface

Variable Documentation

◆ MqFactoryCTT

MK_TYP MqFactoryCTT = NULL
static

Definition at line 26 of file MqFactoryC_rb.c.

◆ OT_CLASS

OT_CLS_T OT_CLASS

Definition at line 23 of file MqFactoryC_rb.c.

◆ rbmqmsgque_id_new

ID rbmqmsgque_id_new
static

Method definition

Definition at line 158 of file MqFactoryC_rb.c.

◆ rbmqmsgque_MqFactoryC_MK_NULL

OT_OBJ_T rbmqmsgque_MqFactoryC_MK_NULL = 0

Definition at line 27 of file MqFactoryC_rb.c.

◆ rbmqmsgque_MqFactoryC_T

rb_data_type_t rbmqmsgque_MqFactoryC_T
static
Initial value:
= {
"MqFactoryC",
{
0,
0,
},
NULL,
NULL,
RUBY_TYPED_FREE_IMMEDIATELY
}
static void rbmkkernel_AtomDeleteSoft(MK_MNG)
static void rbmqmsgque_sMark(MK_PTR)

Definition at line 33 of file MqFactoryC_rb.c.

33 {
34 "MqFactoryC",
35 {
36 NS(sMark),
37 MK(AtomDeleteSoft),
38 0, /* dsize */
39 0, /* reserved[1] */
40 },
41 NULL, /* parent */
42 NULL, /* data */
43 RUBY_TYPED_FREE_IMMEDIATELY
44};