MqFactoryC - various functions to create, initialize and destroy a factory … More...
Collaboration diagram for MqFactoryC_TOR_C_API:Macros | |
| #define | MqFactoryAdd_1(fct) |
| #define | MqFactoryAdd_2(fct, ident) |
| #define | MqFactoryAdd_3(ctor, dtor, ident) |
Functions | |
| void | MqFactoryFree_RT (MK_RT mkrt, MQ_FCT const fct) |
| free internal factory memory and call MqFactoryDTorS::fFree + MqFactoryCTorS::fFree | |
| MQ_FCT | MqFactoryAdd_RT (MK_RT 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_FCT | MqFactoryTypeAdd_RT (MK_RT 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_FCT | MqFactoryDup2_RT (MK_RT mkrt, MQ_FCTN const fct, MK_STRN const ident) |
| create a duplicate of the singleton object MqFactoryC using a new factory-identifer | |
MqFactoryDelete | |
| void | MqFactoryDelete_RT (MK_RT 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 1054 of file msgque_overload_mq.h.
| #define MqFactoryAdd_1 | ( | fct | ) |
Definition at line 3587 of file LibMqMsgque_mq.h.
| #define MqFactoryAdd_2 | ( | fct, | |
| ident ) |
Definition at line 3588 of file LibMqMsgque_mq.h.
| #define MqFactoryAdd_3 | ( | ctor, | |
| dtor, | |||
| ident ) |
Definition at line 3589 of file LibMqMsgque_mq.h.
| #define MqFactoryAdd_NULL | ( | ... | ) |
Definition at line 1053 of file msgque_overload_mq.h.
| #define MqFactoryDelete | ( | x | ) |
Definition at line 1059 of file msgque_overload_mq.h.
| #define MqFactoryDup2 | ( | ... | ) |
Definition at line 1050 of file msgque_overload_mq.h.
| #define MqFactoryDup2_NULL | ( | ... | ) |
Definition at line 1049 of file msgque_overload_mq.h.
| #define MqFactoryFree | ( | ... | ) |
Definition at line 1063 of file msgque_overload_mq.h.
| #define MqFactoryFree_NULL | ( | ... | ) |
Definition at line 1062 of file msgque_overload_mq.h.
| #define MqFactoryTypeAdd | ( | ... | ) |
Definition at line 1056 of file msgque_overload_mq.h.
| #define MqFactoryTypeAdd_NULL | ( | ... | ) |
Definition at line 1055 of file msgque_overload_mq.h.
| MQ_FCT MqFactoryAdd_RT | ( | MK_RT | 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 csmqmsgque features.
The constructor have to be a C# [class] with superclass [MqContextC] …
Example from Filter5.cs → create a new context using factory F1; F2 or F3 read from the commandline
public static void Main(string[] argv) { // create buffer-list of the application arguments MkBufferListC largv = new MkBufferListC(argv); // add factories MqFactoryCT<F1>.Add(); MqFactoryCT<F2>.Add(); MqFactoryCT<F3>.Add(); // select factory using the !first! application argument // and create a new server MqContextC srv = MqFactoryCT<MqContextC>.GetCalled(largv).New(); try { // configure and start the server srv.LinkCreate(largv); // start event-loop and wait forever srv.ProcessEvent(MqWaitOnEventE.FOREVER); } catch (Exception ex) { // set the libmqmsgque error from the csharp error srv.ErrorCatch (ex); } // 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 null 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 |
Destructor - 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_FCT MqFactoryTypeAdd_RT | ( | MK_RT | 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