theLink 10.0
Loading...
Searching...
No Matches
MqContextC_TCL_API

MqContextC - the class known as ctx or context is the application-handle of the application-server and also the main data-handleMore...

+ Collaboration diagram for MqContextC_TCL_API:

Topics

 MqContextC_Class_TCL_API
 MqContextC - define the class …
 
 MqContextC_TOR_TCL_API
 MqContextC - various functions to create, initialize and destroy a context
 
 MqContextC_ClassApi_TCL_API
 MqContextC - access data related to the factory-type of the object …
 
 MqContextC_ConfigApi_TCL_API
 MqContextC - various functions to config a context
 
 MqContextC_Link_TCL_API
 
 MqContextC_SlaveApi_TCL_API
 MqContextC - create and manage a slave context …
 
 MqContextC_SendApi_TCL_API
 MqContextC - construct an outgoing send-data-package
 
 MqContextC_ReadApi_TCL_API
 MqContextC - extract data from an incoming read-data-package
 
 MqContextC_Proxy_TCL_API
 MqContextC - copy data from the read-data-package of the sourceCtx to the send-data-package of the targetCtx
 
 MqContextC_Route_TCL_API
 MqContextC - setup and manage a routing-link
 
 MqContextC_Service_TCL_API
 MqContextC - create and manage a service …
 
 MqContextC_StorageApi_TCL_API
 MqContextC - setup and manage a storage used to persist data-packages
 
 MqContextC_High_TCL_API
 MqContextC - User friendly replacement for the MqContextC_SendApi_C_API and the MqContextC_ReadApi_C_API
 
 MqContextC_Env_TCL_API
 MqContextC - protect and restore the service-environment …
 
 MqContextC_Error_TCL_API
 MqContextC - move and copy an error from a context
 
 MqContextC_Log_TCL_API
 MqContextC - log the output to a string or a MkLogFileC
 
 MqContextC_Filter_TCL_API
 MqContextC - modify the data using the filter-technology
 
 MqContextC_Misc_TCL_API
 MqContextC - various functions to work on a context
 

Functions

static OT_ProcRet tclmqmsgque_MqContextC_Debug (MqContextC_ARGS)
 TCL: $ctx Debug prefix:string
 
static OT_ProcRet tclmqmsgque_MqContextC_printObj (MqContextC_ARGS)
 TCL: $ctx printObj obj:Tcl_Obj ?prefix:string=""?
 

Detailed Description

MqContextC - the class known as ctx or context is the application-handle of the application-server and also the main data-handle

The context is the package-item with the required features and created by the implementation-layer-programmer. The context can be a client or a server.

HOWTO client-context

The client-context-creation is triggerd by the software-workflow on demand. The client is calling the MqLinkCreate to create a connection to the server using the connection-arguments to specify the target.

The life-cycle of a client is:

ContextCreate create and initialize the MqContextC ...
LinkCreate make ctx to a parent-context and setup a new client-server-link
SendTT MqContextC - append a native PRIMITIVE TYPE value to the send-data-package
ReadTT read a PRIMITIVE TYPE from the read-data-package
LinkDelete close the client-server-link
ContextDelete Destructor - delete a MqContextC instance …
Exit delete the context and exit the current process or thread …

HOWTO server-context

The server-context-creation is always triggerd by the MqLinkCreate command of the client. The server is usually using a factory-constructor to call the MqContextCreate and finally to call the MqContextDelete.
The server-context is fully under control of the client.

The life-cycle of a server is:

SETUPdefine a class and add the setup/cleanup code
MqServerSetupIF define the server-setup-interface (callback) used on startup …
ServiceCreate create a link between a service-token and a service-callback
MqServerCleanupIF define the server-cleanup-interface (callback) used on cleanup …
ServiceDelete delete a service. …
STARTUPdefine the factory and start the listener
FactoryAdd Add a new MqFactoryC identified by factory-identifier and defined by factory-constructor
FactoryNew create a new MqContextC from a MqFactoryC
LinkCreate make ctx to a parent-context and setup a new client-server-link
ProcessEvent enter the event-loop and wait for an incoming service-request. …
WORKprocess the service-calls and exit on end
ReadTT read a PRIMITIVE TYPE from the read-data-package
SendTT MqContextC - append a native PRIMITIVE TYPE value to the send-data-package
Exit delete the context and exit the current process or thread …

MqContextC CTOR and DTOR

command alias
(constructor,static) MqContextC [MqContextC Create ?tmpl:MqContextC="MK_NULL"?] tclmqmsgque::MqContextC new ?tmpl:MqContextC=""?
(destructor) $ctx Delete rename $ctx ""

Function Documentation

◆ tclmqmsgque_MqContextC_Debug()

static OT_ProcRet tclmqmsgque_MqContextC_Debug ( MqContextC_ARGS )
static

TCL: $ctx Debug prefix:string

Definition at line 388 of file MqContextC_tcl.c.

389{
391 OT_SETUP_VARARGS(1,1,"$ctx Debug prefix:str")
392 MK_STRN prefix;
393 OT_CHECK_STR(prefix)
395 MkLogC_4X(hdl,"…\n",0,prefix),
397 goto end;
398 error:
400 end:
402}
#define OT_SETUP_VARARGS(min, max, d)
#define OT_retObj_SET_Error
#define OT_retObj_SET_None
#define OT_retObj_RETURN
#define OT_CHECK_NOARGS
#define OT_SETUP_hdl
#define error
Definition high_lng.h:339
const MK_STRB * MK_STRN
#define MkLogC_4X(x, message, debug, callfunc)
#define OT_CHECK_STR(val)

◆ tclmqmsgque_MqContextC_printObj()

static OT_ProcRet tclmqmsgque_MqContextC_printObj ( MqContextC_ARGS )
static

TCL: $ctx printObj obj:Tcl_Obj ?prefix:string=""?

Definition at line 406 of file MqContextC_tcl.c.

407{
409 OT_SETUP_VARARGS(1,2,"$ctx printObj obj:Tcl_Obj ?prefix:string=\"\"?")
410 OT_OBJ_T tclO = 0;
412 MK_STRN prefix="print";
415 MK_OBJ obj;
416 MkTestClassE flag;
417 int mqR;
418 if(OT_LNG_OBJECT_IS_3(tclO, &obj, &flag)) {
419 mqR=-2;
420 switch (flag) {
421 case MkTestClassE_OK: mqR=obj->refCount; break;
422 case MkTestClassE_NULL: mqR=0; break;
423 case MkTestClassE_INVALID_SIGNATURE: mqR=-1; break;
426 case MkTestClassE_INTERNAL: mqR=-2; break;
427 }
428 } else {
429 mqR=-2;
430 }
431 printXV(hdl,"%-10s: string<%s>, type<%s>, refCount[mq=%i,tcl=%i], ptr<%p>\n",
432 prefix, Tcl_GetString(tclO), MK(GetTypeFromObj) (OT_Prefix_CALL tclO, NULL), mqR, tclO->refCount, tclO
433 );
435 goto end;
436 error:
438 end:
440}
#define MK(n)
#define OT_CHECK_REQUIRED(val)
#define OT_Prefix_CALL
#define OT_CHECK_OPTIONAL(val)
Tcl_Obj * OT_OBJ_T
MK_OBJ const obj
Definition high_lng.h:136
if(call==MQ_RET &&highSKIP==highSIZE) goto call
Definition high_lng.h:230
#define OT_LNG_OBJECT_IS_3(objV, obj, flag)
#define OT_CHECK_LNG_T(val)
@ MkTestClassE_NONE_OBJECT
@ MkTestClassE_INTERNAL
@ MkTestClassE_OK
@ MkTestClassE_INVALID_SIGNATURE
@ MkTestClassE_NULL
@ MkTestClassE_WRONG_CLASS
MK_I32 refCount