libmqmsgque 9.0
Loading...
Searching...
No Matches
Modules | Data Structures | Typedefs | Functions
MqContextC_C_API

The MqContextC object known as ctx or context is the main data structure and application-handleMore...

+ Collaboration diagram for MqContextC_C_API:

Modules

 MqContextC_Type_C_API
 BASE-TYPE for the context-type
 
 MqContextC_Class_C_API
 access data related to the type of the object…
 
 MqContextC_Config_C_API
 various functions to 'config' a MqContextC
 
 MqContextC_TOR_C_API
 various functions to create, initialize and destroy a MqContextC
 
 
 MqContextC_SlaveApi_C_API
 create and manage a slave context …
 
 MqContextC_SendApi_C_API
 construct an outgoing send-data-package
 
 MqContextC_ReadApi_C_API
 extract data from an incoming read-data-package. …
 
 MqContextC_Proxy_C_API
 copy data from the read-data-package of the sourceCtx to the send-data-package of the targetCtx
 
 MqContextC_Route_C_API
 setup and manage a routing-link
 
 MqContextC_Service_C_API
 create and manage a service …
 
 MqContextC_StorageApi_C_API
 setup and manage a storage used to persist data-packages
 
 MqContextC_High_C_API
 User friendly replacement for the MqContextC_SendApi_C_API and the MqContextC_ReadApi_C_API
 
 MqContextC_Env_C_API
 protect and restore the service-environment…
 
 MqContextC_Error_C_API
 move and copy an error in a MqContextC
 
 MqContextC_Log_C_API
 log output to string or MkLogFileC
 
 MqContextC_Filter_C_API
 modify data using filter technology …
 
 MqContextC_Misc_C_API
 various functions to work on a MqContextC
 
 MqContextC_Introspection_C_API
 Get information about all instances created by class
 
 MqContextC_Cast_C_API
 cast from defined and undefined instance to MqContextC
 

Data Structures

struct  MQ_CTX_A
 array of MqContextC instances More...
 
struct  MqContextS
 PUBLIC data structure for the libmqmsgque-specific-data More...
 

Typedefs

typedef struct MqCtxTypeSMQ_CTXT
 object context type datatype, use &XX->type to cast to MK_TYP
 

Functions

MK_ERR MqContextErrorDEFAULT (MQ_CTXN const fmtobj)
 helper used to access ErrorDEFAULT from MqContextC
 

MqContextC


typedef struct MqContextSMQ_CTX
 class-shortcut for struct MqContextS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MqContextSMQ_CTXN
 class-shortcut for const struct MqContextS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MqContextS MQ_CTXR
 reference-shortcut for struct MqContextS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MqContextC type definition

typedef struct MqContextS MqContextCR
 instance-struct-reference same as struct MqContextS, useable in a class-macro as: class##R
 
typedef const struct MqContextS MqContextCNR
 const instance-struct-reference same as const struct MqContextS, useable in a class-macro as: class##R
 
#define MqContextC_T   (&MQ_RT_REF._MqContextC_T)
 instance-type as specific-instance-type, useable in a class-macro as: class##_T
 
#define MqContextC_TT   (MkTYP(MqContextC_T))
 instance-type as common-instance-type, useable in a class-macro as: class##_TT
 
#define MqContextST   MqContextC_T
 instance-type as specific-instance-type
 
#define MqContextSTT   (MkTYP(MqContextST))
 instance-type as common-instance-type (cast from MqContextST into MkTypeS) …
 
#define MqContextC_type   MQ_CTX
 same as MqContextS but useable in a class-macro as: class##_type
 
#define MqContextCT_X(instance)   ( (struct MqCtxTypeS *) (MkOBJ_R(instance).type) )
 cast from an instance into the specific-instance-type
 
#define MqContextCTT_X(instance)   (MkOBJ_R(instance).type)
 cast from an instance into the common-instance-type
 
#define MqContextCT_TT(typ)   ( (struct MqCtxTypeS *) (typ) )
 cast from an common-instance-type into an specific-instance-type
 
#define MqContextC_NS   MQ
 map class to namespace …
 
#define MqContextCTT   MqContextCTT
 instance-type as common-instance-type for MqContextC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)
 
#define MqContextCT   ( (struct MqCtxTypeS *) MqContextCTT )
 instance-type as specific-instance-type for MqContextC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)
 

MqContextC signature check

bool MqCtxCheck (MK_MNGN mng)
 check MqContextS%->Mk{ObjectS::signature} …
 
#define MqContextC_Check(mng)   MqCtxCheck(mng)
 

MqContextC signature define

#define MqContextC_SIGNATURE   (MkObjectC_SIGNATURE ^ (13u<<10))
 
#define MqContextC_MASK   (((1u<<22)-1)<<10)
 

MqContextC cast to superclass

#define MqContextC_X2ctx(x)   (x)
 
#define MqContextC_X2obj(x)   MkOBJ(x)
 

Detailed Description

The MqContextC object known as ctx or context is the main data structure and application-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 LinkCreate 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 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 LinkCreate command of the client. The server is usually using a factory-constructor to call the ContextCreate and finally to call the ContextDelete.
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
IServerSetup define the server-setup-interface (callback) used on startup …
ServiceCreate create a link between a service-token and a service-callback
IServerCleanup 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 append a native PRIMITIVE TYPE value to the send-data-package. …
Exit delete the context and exit the current process or thread …

MqContextS CTOR and DTOR

command alias
(constructor) MQ_CTX MqContextCreate(MK_TYP type, MQ_CTX tmpl) no
void MqContextDelete(MQ_CTX ctx) no

Macro Definition Documentation

◆ MqContextC_Check

#define MqContextC_Check (   mng)    MqCtxCheck(mng)

Definition at line 3895 of file msgque_mq.h.

◆ MqContextC_MASK

#define MqContextC_MASK   (((1u<<22)-1)<<10)

Definition at line 3832 of file msgque_mq.h.

◆ MqContextC_NS

#define MqContextC_NS   MQ

map class to namespace …

Definition at line 3871 of file msgque_mq.h.

◆ MqContextC_SIGNATURE

#define MqContextC_SIGNATURE   (MkObjectC_SIGNATURE ^ (13u<<10))

Definition at line 3831 of file msgque_mq.h.

◆ MqContextC_T

#define MqContextC_T   (&MQ_RT_REF._MqContextC_T)

instance-type as specific-instance-type, useable in a class-macro as: class##_T

Definition at line 3855 of file msgque_mq.h.

◆ MqContextC_TT

#define MqContextC_TT   (MkTYP(MqContextC_T))

instance-type as common-instance-type, useable in a class-macro as: class##_TT

Definition at line 3857 of file msgque_mq.h.

◆ MqContextC_type

#define MqContextC_type   MQ_CTX

same as MqContextS but useable in a class-macro as: class##_type

Definition at line 3863 of file msgque_mq.h.

◆ MqContextC_X2ctx

#define MqContextC_X2ctx (   x)    (x)

Definition at line 3840 of file msgque_mq.h.

◆ MqContextC_X2obj

#define MqContextC_X2obj (   x)    MkOBJ(x)

Definition at line 3841 of file msgque_mq.h.

◆ MqContextCT

#define MqContextCT   ( (struct MqCtxTypeS *) MqContextCTT )

instance-type as specific-instance-type for MqContextC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)

Definition at line 3875 of file msgque_mq.h.

◆ MqContextCT_TT

#define MqContextCT_TT (   typ)    ( (struct MqCtxTypeS *) (typ) )

cast from an common-instance-type into an specific-instance-type

Definition at line 3869 of file msgque_mq.h.

◆ MqContextCT_X

#define MqContextCT_X (   instance)    ( (struct MqCtxTypeS *) (MkOBJ_R(instance).type) )

cast from an instance into the specific-instance-type

Definition at line 3865 of file msgque_mq.h.

◆ MqContextCTT

#define MqContextCTT   MqContextCTT

instance-type as common-instance-type for MqContextC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)

Definition at line 3873 of file msgque_mq.h.

◆ MqContextCTT_X

#define MqContextCTT_X (   instance)    (MkOBJ_R(instance).type)

cast from an instance into the common-instance-type

Definition at line 3867 of file msgque_mq.h.

◆ MqContextST

#define MqContextST   MqContextC_T

instance-type as specific-instance-type

Definition at line 3859 of file msgque_mq.h.

◆ MqContextSTT

#define MqContextSTT   (MkTYP(MqContextST))

instance-type as common-instance-type (cast from MqContextST into MkTypeS) …

Definition at line 3861 of file msgque_mq.h.

Typedef Documentation

◆ MQ_CTX

class-shortcut for struct MqContextS *, all shortcut using the XX_YYY syntax (only for public API) …

Definition at line 525 of file msgque_mq.h.

◆ MQ_CTXN

class-shortcut for const struct MqContextS *, all const shortcut using the XX_YYYC syntax (only for public API) …

Definition at line 528 of file msgque_mq.h.

◆ MQ_CTXR

reference-shortcut for struct MqContextS, all shortcut using the XX_YYYR syntax (only for public API) …

Definition at line 531 of file msgque_mq.h.

◆ MQ_CTXT

object context type datatype, use &XX->type to cast to MK_TYP

Definition at line 749 of file msgque_mq.h.

◆ MqContextCNR

const instance-struct-reference same as const struct MqContextS, useable in a class-macro as: class##R

Definition at line 3853 of file msgque_mq.h.

◆ MqContextCR

instance-struct-reference same as struct MqContextS, useable in a class-macro as: class##R

Definition at line 3851 of file msgque_mq.h.

Function Documentation

◆ MqContextErrorDEFAULT()

MK_ERR MqContextErrorDEFAULT ( MQ_CTXN const  fmtobj)
inline

helper used to access ErrorDEFAULT from MqContextC

Definition at line 4090 of file msgque_mq.h.

◆ MqCtxCheck()

bool MqCtxCheck ( MK_MNGN  mng)
inline

check MqContextS%->Mk{ObjectS::signature} …

Returns
TRUE on valid ctx and FALSE an invalid ctx

Definition at line 3890 of file msgque_mq.h.

+ Here is the caller graph for this function: