MqFactoryC - various functions to work on a factory … More...
Functions | |
MQ_FCT | MqFactoryDefault (MQ_FCT const fct) |
set the default-attribute to the factory … | |
MQ_FCT | MqFactoryInitial (MQ_FCT const fct) |
set the initial-attribut to fct … | |
MK_STRN | MqFactoryDefaultIdent (void) |
return the factory-identifier of the default MqFactoryC | |
MK_STRN | MqFactoryInitialIdent (void) |
return the factory-identifier of the initial MqFactoryC | |
enum MkErrorE | MqFactoryNew_RT (MK_RT mkrt, MQ_FCT const fct, MQ_CTX const tmpl, MQ_CTX *const val_out) |
create a new MqContextC from a MqFactoryC … | |
void | MqFactoryLogAll_RT (MK_RT mkrt, MK_STRN const callfunc) |
log all "factories" to stderr | |
MqFactoryLog | |
void | MqFactoryLog_RT (MK_RT mkrt, MQ_FCTN const fct, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl) |
log the MqFactoryC … | |
#define | MqFactoryLog_2M(fct, m) |
MqFactoryC - MqFactoryC_Misc_C_API - overload | |
#define | MqFactoryNew_NULL(...) |
#define | MqFactoryNew(...) |
#define | MqFactoryNew_2(fct, val_out) |
#define | MqFactoryNew_E(...) |
#define | MqFactoryNew_C(...) |
#define | MqFactoryNew_e(...) |
#define | MqFactoryLog_NULL(...) |
#define | MqFactoryLog(...) |
#define | MqFactoryLog_4(fct, fmtobj, debug, callfunc) |
#define | MqFactoryLog_3(fct, fmtobj, debug) |
#define | MqFactoryLog_2(fct, fmtobj) |
#define | MqFactoryLog_1(fct) |
#define | MqFactoryLogAll_NULL(...) |
#define | MqFactoryLogAll(...) |
#define | MqFactoryLogAll_0() |
MqFactoryC - various functions to work on a factory …
#define MqFactoryLog | ( | ... | ) |
Definition at line 1018 of file msgque_overload_mq.h.
#define MqFactoryLog_1 | ( | fct | ) |
Definition at line 1022 of file msgque_overload_mq.h.
#define MqFactoryLog_2 | ( | fct, | |
fmtobj ) |
Definition at line 1021 of file msgque_overload_mq.h.
#define MqFactoryLog_2M | ( | fct, | |
m ) |
Definition at line 3694 of file LibMqMsgque_mq.h.
#define MqFactoryLog_3 | ( | fct, | |
fmtobj, | |||
debug ) |
Definition at line 1020 of file msgque_overload_mq.h.
#define MqFactoryLog_4 | ( | fct, | |
fmtobj, | |||
debug, | |||
callfunc ) |
Definition at line 1019 of file msgque_overload_mq.h.
#define MqFactoryLog_NULL | ( | ... | ) |
Definition at line 1017 of file msgque_overload_mq.h.
#define MqFactoryLogAll | ( | ... | ) |
Definition at line 1026 of file msgque_overload_mq.h.
#define MqFactoryLogAll_0 | ( | ) |
Definition at line 1027 of file msgque_overload_mq.h.
#define MqFactoryLogAll_NULL | ( | ... | ) |
Definition at line 1025 of file msgque_overload_mq.h.
#define MqFactoryNew | ( | ... | ) |
Definition at line 1010 of file msgque_overload_mq.h.
#define MqFactoryNew_2 | ( | fct, | |
val_out ) |
Definition at line 1011 of file msgque_overload_mq.h.
#define MqFactoryNew_C | ( | ... | ) |
Definition at line 1013 of file msgque_overload_mq.h.
#define MqFactoryNew_E | ( | ... | ) |
Definition at line 1012 of file msgque_overload_mq.h.
#define MqFactoryNew_e | ( | ... | ) |
Definition at line 1014 of file msgque_overload_mq.h.
#define MqFactoryNew_NULL | ( | ... | ) |
Definition at line 1009 of file msgque_overload_mq.h.
set the default-attribute to the factory …
The default-factory is used to create an MqFactoryC if MqFactoryGetCalled was not able to find a specific factory object. This is designed for a scenario with multiple factories included into a single binary and the first commandline parameter after the executable name… (position 0=executable, position 1=factory-selector)… is not related to a factory-ident… added with MqFactoryAdd.
[in] | fct | the new default MqFactoryC |
Example: from example/py/server.cs
MK_STRN MqFactoryDefaultIdent | ( | void | ) |
set the initial-attribut to fct
…
The factory with "Initial"-attribute is always used for an object that should only be created with the MqContextC base class, but for which no other factory has been specified.
Use this attribute with care because you are firmly linking a factory. In a programming language with class-support, such as C++ or C#, this class is used for every new MqContextC object.
Where "Reflection" is available, this attribute has less meaning since the class is primarily determined from the parent object by means of "Reflection".
The "Initial" attribute is otherwise used for the "Loopback" and the "Filter" capability.
Example from Filter4.py
→ set Initial attribute to a Factory
MqFactoryC.Add(Filter4, "transFilter").Initial() # "srv" get the "Initial" factory srv = Filter4() try: srv.LinkCreate(sys.argv) srv.ProcessEvent(MqWaitOnEventE.FOREVER) except Exception as ex: srv.ErrorCatch(ex); finally: srv.Exit()
[in] | fct | the new initial MqFactoryC |
MK_STRN MqFactoryInitialIdent | ( | void | ) |
void MqFactoryLog_RT | ( | MK_RT | mkrt, |
MQ_FCTN const | fct, | ||
MK_OBJN | fmtobj, | ||
MK_DBG const | debug, | ||
MK_STRN const | callfunc, | ||
MK_I32 const | lvl ) |
log the MqFactoryC …
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | fct | the MqFactoryS instance to work on |
[in] | fmtobj | managed object used to format the log-message (default=None → use default-format) |
[in] | debug | the debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0 ) |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
[in] | lvl | a user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0 ) |
log all "factories" to stderr
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
enum MkErrorE MqFactoryNew_RT | ( | MK_RT | mkrt, |
MQ_FCT const | fct, | ||
MQ_CTX const | tmpl, | ||
MQ_CTX *const | val_out ) |
create a new MqContextC from a MqFactoryC …
this create only the initial-server-object… all other server-objects will be created on behalf of the client-request.
Example from MyServer.py
→ create a new server context
import sys from pymqmsgque import * # package-item class MyServer(MqContextC): # factory startup def __init__(self, tmpl=None): self.ConfigSetServerSetup(self.ServerSetup) super().__init__(tmpl) # service to serve all incoming requests for token "HLWO" def MyFirstService(self): self.SendSTART() self.SendSTR(self.ReadSTR() + " World") self.SendRETURN() # define a service as link between the token "HLWO" and the callback "MyFirstService" def ServerSetup(self): self.ServiceCreate("HLWO",self.MyFirstService) # package-main if __name__ == "__main__": # create the "MyServer" factory… and the object srv = MqFactoryC.Add(MyServer).New() try: srv.LinkCreate(sys.argv) srv.ProcessEvent(MqWaitOnEventE.FOREVER) except Exception as ex: srv.ErrorCatch(ex) finally: srv.Exit()
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | fct | a MqFactoryC used to create a MqContextC |
[in] | tmpl | (C-API only) template for context intialization |
[out] | val_out | the new context object as return or None on error |
None
pointer