MqContextC - various functions to create, initialize and destroy a context … More...
Functions | |
void | MqContextInit_RT (MK_RT mkrt, MQ_CTX const ctx, MK_TYP type, MQ_CTX const tmpl) |
initialize the MqContextC object related data but do not create the object self | |
void | MqContextFree_RT (MK_RT mkrt, MQ_CTX const ctx) |
free the MqContextC object related data but do not free the toplevel object self … | |
MQ_CTX | MqContextCreate_RT (MK_RT mkrt, MK_TYP type, MQ_CTX const tmpl) |
create and initialize the MqContextC ... | |
MQ_CTX | MqContextSetup_RT (MK_RT mkrt, MK_TYP type, MQ_CTX const tmpl, MQ_CTX *ctx_out) |
MqContextDelete | |
void | MqContextDelete_RT (MK_RT mkrt, MQ_CTX ctx) |
Destructor - delete a MqContextC instance … | |
MqContextC - MqContextC_TOR_C_API - overload | |
#define | MqContextCreate_NULL(...) |
#define | MqContextCreate(...) |
#define | MqContextCreate_1(tmpl) |
#define | MqContextCreate_0() |
#define | MqContextSetup_NULL(...) |
#define | MqContextSetup(...) |
#define | MqContextSetup_2(tmpl, ctx_out) |
#define | MqContextSetup_1(ctx_out) |
#define | MqContextDelete(x) |
#define | MqContextFree_NULL(...) |
#define | MqContextFree(...) |
#define | MqContextInit_NULL(...) |
#define | MqContextInit(...) |
MqContextC - various functions to create, initialize and destroy a context …
#define MqContextCreate | ( | ... | ) |
Definition at line 861 of file msgque_overload_mq.h.
#define MqContextCreate_0 | ( | ) |
Definition at line 863 of file msgque_overload_mq.h.
#define MqContextCreate_1 | ( | tmpl | ) |
Definition at line 862 of file msgque_overload_mq.h.
#define MqContextCreate_NULL | ( | ... | ) |
Definition at line 860 of file msgque_overload_mq.h.
#define MqContextDelete | ( | x | ) |
Definition at line 870 of file msgque_overload_mq.h.
#define MqContextFree | ( | ... | ) |
Definition at line 874 of file msgque_overload_mq.h.
#define MqContextFree_NULL | ( | ... | ) |
Definition at line 873 of file msgque_overload_mq.h.
#define MqContextInit | ( | ... | ) |
Definition at line 876 of file msgque_overload_mq.h.
#define MqContextInit_NULL | ( | ... | ) |
Definition at line 875 of file msgque_overload_mq.h.
#define MqContextSetup | ( | ... | ) |
Definition at line 865 of file msgque_overload_mq.h.
#define MqContextSetup_1 | ( | ctx_out | ) |
Definition at line 867 of file msgque_overload_mq.h.
#define MqContextSetup_2 | ( | tmpl, | |
ctx_out ) |
Definition at line 866 of file msgque_overload_mq.h.
#define MqContextSetup_NULL | ( | ... | ) |
Definition at line 864 of file msgque_overload_mq.h.
create and initialize the MqContextC ...
This function is used to create a single new context… primary on the client. to create multiple new context on a server… a MqFactoryC is used.
The new instance belongs to the caller and may have to be released if necessary. A manual release using ContextDelete is always possible, but the instance can no longer be used afterwards.
Example from MyClient.c
→ create a context using the static libmqmsgque CTOR
#include "debug_mq.h" #include "msgque_mq.h" int main (int argc, MK_STRN argv[]) { MkRtSetup_NULL; struct MkBufferListS * largv = MkBufferListCreateVC(argc, argv); // create a context using the static libmqmsgque CTOR function "MqContextCreate" MQ_CTX ctx = MqContextCreate(NULL,NULL); MqConfigSetName(ctx, "MyClient"); MqLinkCreate_E (ctx, largv); MqCheckForLeftOverArguments_E (ctx, largv); MqSend_E (ctx, "W", "HLWO:C", "Hello"); fprintf(stdout,"%s\n", MqReadSTR_e (ctx)); fflush(stdout); error: MkBufferListDelete(largv); // delete the context using the libmqmsgque APPLICATION-DTOR function "MqExit_1" MqExit_1(ctx); }
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | type | type type of the object like MqContextC_T or a new type created with MkTypeDup2. (default: MK_NULL , reuse the MkTypeSTT from tmpl or use MqContextC_T if tmpl = MK_NULL ) |
[in] | tmpl | an other context-data-structure used as template to initialize the configuration data. This template is used for a child to get the configuration data from the parent. (default: MK_NULL , create an initial context) |
Destructor - delete a MqContextC instance …
Shutdown the client-server-link, free the memory and set the ctx to MK_NULL
. The context can not be reused.
Example from MyClient2.c
→ delete a application-context using the libmqmsgque DTOR
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ctx | the MqContextS instance to work on |
free the MqContextC object related data but do not free the toplevel object self …
Shutdown the client-server-link and free the related memory. The toplevel object is still alive to give an existing Garbage-Collection the control when to delete the object. The context can not be reused.
initialize the MqContextC object related data but do not create the object self
same as MqContextCreate but use an already-existing instance of ctx_out
If *ctx_out
is not null than MqContextSetup assume an allready-existing storage and ctx_out is only initialized.
perfserver.c
with factory support