MqFactoryC - various functions to create, initialize and destroy a factory … More...
Macros | |
#define | MqFactoryAdd_1(fct) |
#define | MqFactoryAdd_2(fct, ident) |
Functions | |
MQ_EXTERN void | MqFactoryFree_RT (MK_RT const mkrt, MQ_FCT const fct) |
free internal factory memory and call MqFactoryDTorS::fFree + MqFactoryCTorS::fFree | |
MQ_EXTERN MQ_FCT | MqFactoryAdd_RT (MK_RT const mkrt, MK_OBJN const error, MqFactoryCTorF const createCallF, MK_CCP const constructor, MqFactoryDataFreeF const createDataFreeF, MqFactoryDataCopyF const createDataCopyF, MqFactoryDTorF const deleteCallF, MK_CCP const destructor, MqFactoryDataFreeF const deleteDataFreeF, MqFactoryDataCopyF const deleteDataCopyF, MK_STRN const ident) |
add a new MqFactoryC identified by factory-identifier and defined by factory-constructor … | |
MQ_EXTERN MQ_FCT | MqFactoryTypeAdd_RT (MK_RT const mkrt, MK_OBJN const error, MK_STRN const ident, MkSelfCreateF const fctCreate, MkSelfDeleteF const fctDelete, MkConstructorF const constructor, MkSelfDeleteF const selfDelete) |
add a new MqFactoryS-Object identified by a fctT | |
MQ_EXTERN MQ_FCT | MqFactoryDup2_RT (MK_RT const mkrt, MQ_FCTN const fct, MK_STRN const ident) |
create a duplicate of the singleton object MqFactoryC using a new factory-identifer | |
MqFactoryDelete | |
MQ_EXTERN void | MqFactoryDelete_RT (MK_RT const mkrt, MQ_FCT fct) |
Destructor - delete a MqFactoryC instance … | |
MqFactoryC - MqFactoryC_TOR_C_API - overload | |
#define | MqFactoryDup2_NULL(...) |
#define | MqFactoryDup2(...) |
#define | MqFactoryAdd_NULL(...) |
#define | MqFactoryAdd(...) |
#define | MqFactoryTypeAdd_NULL(...) |
#define | MqFactoryTypeAdd(...) |
#define | MqFactoryDelete(x) |
#define | MqFactoryFree_NULL(...) |
#define | MqFactoryFree(...) |
MqFactoryC - various functions to create, initialize and destroy a factory …
#define MqFactoryAdd | ( | ... | ) |
Definition at line 1042 of file msgque_overload_mq.h.
#define MqFactoryAdd_1 | ( | fct | ) |
Definition at line 3484 of file LibMqMsgque_mq.h.
#define MqFactoryAdd_2 | ( | fct, | |
ident ) |
Definition at line 3485 of file LibMqMsgque_mq.h.
#define MqFactoryAdd_NULL | ( | ... | ) |
Definition at line 1041 of file msgque_overload_mq.h.
#define MqFactoryDelete | ( | x | ) |
Definition at line 1047 of file msgque_overload_mq.h.
#define MqFactoryDup2 | ( | ... | ) |
Definition at line 1038 of file msgque_overload_mq.h.
#define MqFactoryDup2_NULL | ( | ... | ) |
Definition at line 1037 of file msgque_overload_mq.h.
#define MqFactoryFree | ( | ... | ) |
Definition at line 1051 of file msgque_overload_mq.h.
#define MqFactoryFree_NULL | ( | ... | ) |
Definition at line 1050 of file msgque_overload_mq.h.
#define MqFactoryTypeAdd | ( | ... | ) |
Definition at line 1044 of file msgque_overload_mq.h.
#define MqFactoryTypeAdd_NULL | ( | ... | ) |
Definition at line 1043 of file msgque_overload_mq.h.
MQ_EXTERN MQ_FCT MqFactoryAdd_RT | ( | MK_RT const | mkrt, |
MK_OBJN const | error, | ||
MqFactoryCTorF const | createCallF, | ||
MK_CCP const | constructor, | ||
MqFactoryDataFreeF const | createDataFreeF, | ||
MqFactoryDataCopyF const | createDataCopyF, | ||
MqFactoryDTorF const | deleteCallF, | ||
MK_CCP const | destructor, | ||
MqFactoryDataFreeF const | deleteDataFreeF, | ||
MqFactoryDataCopyF const | deleteDataCopyF, | ||
MK_STRN const | ident ) |
add a new MqFactoryC identified by factory-identifier and defined by factory-constructor …
The factory is required to get all pymqmsgque features.
The constructor have to be a Python [class] with superclass [MqContextC] …
vim:syntax=cpp.doxygen
Example from Filter5.py
→ create a new context using factory F1; F2 or F3 read from the commandline
if __name__ == "__main__": # create buffer-list of the application arguments largv = MkBufferListC.CreateLA(sys.argv) # add factories MqFactoryC.Add(F1) MqFactoryC.Add(F2) MqFactoryC.Add(F3) # select factory using the !first! application argument # and create a new server srv = MqFactoryC.GetCalledL(largv).New() try: # configure and start the server srv.LinkCreate(largv) # start event-loop and wait forever srv.ProcessEvent(MqWaitOnEventE.FOREVER) except Exception as ex: # set the libmqmsgque error from the python error srv.ErrorCatch(ex); finally: # exit aplication and cleanup the environment srv.Exit()
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | error | (C-API) flag to signal how to report an error. valid values are: MK_ERROR_PANIC, MK_ERROR_PRINT, MK_ERROR_IGNORE or an other MqContextC |
[in] | ident | the factory-identifier, if None or EMPTY the class-name is used. The ident is the public identifier (name) of the factory and is used in logging-output (MqLog...) , name-resolution (MqFactoryGet...) and an first parameter in the executable-call: myserver ident ... . |
[in] | createCallF | (C-API) object constructor function |
[in] | constructor | object (class) constructor data |
[in] | createDataFreeF | (C-API) object constructor data free function |
[in] | createDataCopyF | (C-API) object copy-constructor data free function |
[in] | deleteCallF | (C-API) object destructor function |
[in] | destructor | object (class) destructor data |
[in] | deleteDataFreeF | (C-API) object destructor data free function |
[in] | deleteDataCopyF | (C-API) object copy-constructor data free function |
None
on errorDestructor - delete a MqFactoryC instance …
The factory-delete is more a pseudo-delete because a factory is always in-duty:
create a duplicate of the singleton object MqFactoryC using a new factory-identifer
free internal factory memory and call MqFactoryDTorS::fFree + MqFactoryCTorS::fFree
MQ_EXTERN MQ_FCT MqFactoryTypeAdd_RT | ( | MK_RT const | mkrt, |
MK_OBJN const | error, | ||
MK_STRN const | ident, | ||
MkSelfCreateF const | fctCreate, | ||
MkSelfDeleteF const | fctDelete, | ||
MkConstructorF const | constructor, | ||
MkSelfDeleteF const | selfDelete ) |
add a new MqFactoryS-Object identified by a fctT
This factory is used for template based factories like in C++.
MqFactoryCT<Server>::Add("server")->Default();
A template create for every new class Server a new factory object. Both, the new Server and the new factory require own functions for self create.Example from MqFactoryC_cc.hh
→ create the self constructor/destructor