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 | libmqmsgque::MqFactoryFree_RT (MK_RT mkrt, MQ_FCT const fct) |
| free internal factory memory and call libmqmsgque::MqFactoryDTorS::fFree + libmqmsgque::MqFactoryCTorS::fFree | |
| MQ_FCT | libmqmsgque::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 | libmqmsgque::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 | libmqmsgque::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 | libmqmsgque::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 libmqmsgque::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 ccmqmsgque features.
The constructor have to be a C++ [class] with superclass [MqContextC] …
new function.MyServer with public name "MyServer" as a factory-class Example from Filter5.cc → create a new context using factory F1; F2 or F3 read from the commandline
int MK_CDECL main (int argc, MK_STRN argv[]) { MqMsgque::CcMqSetup(); // create buffer-list of the application arguments auto largs = MkBufferListC {argc, argv}; // init libmqmsgque global applications starter MqInitSetArg0VA(argv[0],NULL); // add factories MqFactoryCT<F1>::Add("F1"); MqFactoryCT<F2>::Add("F2"); MqFactoryCT<F3>::Add("F3"); // call factory using the !second! application argument, // first argument is the executable self MqContextC *filter = MqFactoryCT<MqContextC>::GetCalled(&largs)->New(); try { // configure and start the server filter->LinkCreate (largs); // start event-loop and wait forever filter->ProcessEvent (MQ_WAIT_FOREVER); } catch (const exception& e) { // set the libmqmsgque error form the c++ error filter->ErrorCatch(e); } return filter->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 MK_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 |
MK_NULL 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 libmqmsgque::MqFactoryDTorS::fFree + libmqmsgque::MqFactoryCTorS::fFree
| MQ_FCT libmqmsgque::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