theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib
c - tcl - atl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
MqFactoryC_C_API

MqFactoryC - the class known as fct or factory is used to provide an interface to create one or more new MqContextCMore...

+ Collaboration diagram for MqFactoryC_C_API:

Topics

 MqFactoryC_Class_C_API
 MqFactoryC - define the class …
 
 MqFactoryC_TOR_C_API
 MqFactoryC - various functions to create, initialize and destroy a factory
 
 MqFactoryC_Get_C_API
 MqFactoryC - various functions to 'get' data out of a factory
 
 MqFactoryC_Misc_C_API
 MqFactoryC - various functions to work on a factory
 

Data Structures

struct  MqFactoryCTorS
 interface for the constructor More...
 
struct  MqFactoryDTorS
 interface for the destructor More...
 
struct  MqFactoryS
 data used to define a factory More...
 

Macros

#define MqFactoryPanic(fct)
 
#define MQ_CALLBACK_FACTORY_CTOR_ARGS
 the MqFactoryCTorF arguments with default names
 
#define MQ_CALLBACK_FACTORY_CTOR_CALL   MQ_RT_CALL tmpl, create, fct, contextP
 
#define MQ_CALLBACK_FACTORY_DTOR_ARGS
 the MqFactoryCTorF arguments with default names
 
#define MqDbgFct_2(f, c)
 
#define MqDbgFct(f)
 

Typedefs

typedef enum MkErrorE(* MqFactoryCTorF) (MK_RT mkrt, MQ_RT mqrt, MQ_CTX const tmpl, enum MqFactoryE create, MQ_FCT const fct, MQ_CTX *ctx_out)
 type of a MqFactoryC constructor
 
typedef void(* MqFactoryDTorF) (MK_RT mkrt, MQ_CTX ctx, bool doFactoryCleanup, MQ_FCT const fct)
 type of a MqFactoryC destructor
 
typedef void(* MqFactoryDataFreeF) (MK_RT mkrt, MK_PTR *dataP)
 prototype for a free additional factory data function
 
typedef void(* MqFactoryDataCopyF) (MK_RT mkrt, MK_PTR *dataP)
 prototype for a copy additional factory data function
 

Detailed Description

MqFactoryC - the class known as fct or factory is used to provide an interface to create one or more new MqContextC

The factory is an important part of the object management and has the following basic features:

  1. create/delete a MqContextC defined by a MqFactoryC
  2. infrastructure to host multiple MqFactoryC in a single executable
  3. provide an identifier used for factory-lookup and as an unique-application-name
  4. identification of a client and a server in an application-link

Without a factory only the pipe-feature without the child-feature is guaranteed to work. Other features may work, this depends of the "flexibility" of the programming-language.

The link between the MqFactoryS-identifier and the MqFactoryC is important for the future development of libmqmsgque. Message-Routing, Service-Location and Persistent-Transactions depend on this feature.

The relationship between the MqFactoryC and the MqContextC is the same as the relationship between a type (MqFactoryS) and an object (MqContextS) of a regular programming language. The MqFactoryC define the type of the server and the MqContextC define a single object of the server process or thread.

                                     Application
|-------------------------------------------------------------------------------------|
|--------------- physical host 1 -----------------------|------ physical host 2 ------|
|-------- process-1 --------|-------- process-2 --------|-- process-3 --|---- … ------|
 thread-1     thread-2…      thread-1…     thread-2…      thread-1…       thread-…
  factory-A     factory-X     factory-Y…    factory-Z…
   object-1     object-1   object-…    …
   object-2     object-2   …
   object-3     object-3
   …              …

A server has a single MqFactoryC object per thread or process but multiple MqFactoryC objects per application. Decreasing the size and the complexity of a MqContextC object will improve the server performance. In future more fields, defined in the MqSetupS attribute of the the MqContextC object, will move into MqFactoryC object.

Macro Definition Documentation

◆ MQ_CALLBACK_FACTORY_CTOR_ARGS

#define MQ_CALLBACK_FACTORY_CTOR_ARGS
Value:
MQ_RT_ARGS \
MQ_CTX const tmpl, \
enum MqFactoryE create, \
struct MqFactoryS * const fct, \
MQ_CTX *contextP \
MqFactoryE
the factory is called to create an object for ...
PUBLIC data structure for the libmqmsgque-specific-data
data used to define a factory

the MqFactoryCTorF arguments with default names

Definition at line 3092 of file LibMqMsgque_mq.h.

3092#define MQ_CALLBACK_FACTORY_CTOR_ARGS \
3093 MQ_RT_ARGS \
3094 MQ_CTX const tmpl, \
3095 enum MqFactoryE create, \
3096 struct MqFactoryS * const fct, \
3097 MQ_CTX *contextP \
3098

◆ MQ_CALLBACK_FACTORY_CTOR_CALL

#define MQ_CALLBACK_FACTORY_CTOR_CALL   MQ_RT_CALL tmpl, create, fct, contextP

Definition at line 3099 of file LibMqMsgque_mq.h.

◆ MQ_CALLBACK_FACTORY_DTOR_ARGS

#define MQ_CALLBACK_FACTORY_DTOR_ARGS
Value:
MQ_RT_ARGS \
MQ_CTX ctx, \
bool doFactoryCleanup, \
MQ_FCT const fct \

the MqFactoryCTorF arguments with default names

Definition at line 3124 of file LibMqMsgque_mq.h.

3124#define MQ_CALLBACK_FACTORY_DTOR_ARGS \
3125 MQ_RT_ARGS \
3126 MQ_CTX ctx, \
3127 bool doFactoryCleanup, \
3128 MQ_FCT const fct \
3129

◆ MqDbgFct

#define MqDbgFct ( f)
Value:
MqDbgFct_2(f,MK_COLOR_YELLOW)
#define MqDbgFct_2(f, c)

Definition at line 3167 of file LibMqMsgque_mq.h.

◆ MqDbgFct_2

#define MqDbgFct_2 ( f,
c )
Value:
mk_dbg_color_ln(c,"MqDbgFct[%-16s]: fct<P=%p:T=%p:R=%p>, MqFactoryC_TT<%p>", \
MK_TRIM_LEFT(16,f->originalIdent), f, MkTYP_X(f), MkRT_X(f), MqFactoryC_TT)
#define MkRT_X(x)
#define MkTYP_X(x)
#define MqFactoryC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …

Definition at line 3164 of file LibMqMsgque_mq.h.

3164#define MqDbgFct_2(f,c) \
3165 mk_dbg_color_ln(c,"MqDbgFct[%-16s]: fct<P=%p:T=%p:R=%p>, MqFactoryC_TT<%p>", \
3166 MK_TRIM_LEFT(16,f->originalIdent), f, MkTYP_X(f), MkRT_X(f), MqFactoryC_TT)

◆ MqFactoryPanic

#define MqFactoryPanic ( fct)
Value:
if (fct == NULL) MkPanicC(MK_ERROR_PANIC, __func__, -1, "MqFactoryS exception");
#define MkPanicC(...)
#define MK_ERROR_PANIC

Definition at line 3071 of file LibMqMsgque_mq.h.

Typedef Documentation

◆ MqFactoryCTorF

typedef enum MkErrorE( * MqFactoryCTorF) (MK_RT mkrt, MQ_RT mqrt, MQ_CTX const tmpl, enum MqFactoryE create, MQ_FCT const fct, MQ_CTX *ctx_out)

type of a MqFactoryC constructor

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]mqrtthe MqRuntimeS instance to work on - the runtime argument, used by MQ_RT_CALL (C-only)
[in]tmplthe calling object to initialize the configuration data using MqSetupDup
[in]createhow is the factory constructor used
[in]fctfactory interface in use
[out]ctx_outthe new object
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

Definition at line 3000 of file LibMqMsgque_mq.h.

◆ MqFactoryDataCopyF

typedef void( * MqFactoryDataCopyF) (MK_RT mkrt, MK_PTR *dataP)

prototype for a copy additional factory data function

Definition at line 3139 of file LibMqMsgque_mq.h.

◆ MqFactoryDataFreeF

typedef void( * MqFactoryDataFreeF) (MK_RT mkrt, MK_PTR *dataP)

prototype for a free additional factory data function

Definition at line 3131 of file LibMqMsgque_mq.h.

◆ MqFactoryDTorF

typedef void( * MqFactoryDTorF) (MK_RT mkrt, MQ_CTX ctx, bool doFactoryCleanup, MQ_FCT const fct)

type of a MqFactoryC destructor

  • this callback will be called at MqContextDelete to cleanup factory-related-data.
  • the MqContextDelete have to be called again to finish the cleanup of context-related-data.
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in]doFactoryCleanupwas the object created with a factory ?
[in]fctfactory-interface used to create the object, the factory entry at MqSetupS::factory was set to MK_NULL in MqContextCreate to garantee a one time execution of this code

Definition at line 3114 of file LibMqMsgque_mq.h.