theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - 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
 

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 pymqmsgque. 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 pymqmsgque-specific-data
data used to define a factory

the MqFactoryCTorF arguments with default names

Definition at line 3057 of file LibMqMsgque_mq.h.

3057#define MQ_CALLBACK_FACTORY_CTOR_ARGS \
3058 MQ_RT_ARGS \
3059 MQ_CTX const tmpl, \
3060 enum MqFactoryE create, \
3061 struct MqFactoryS * const fct, \
3062 MQ_CTX *contextP \
3063

◆ MQ_CALLBACK_FACTORY_CTOR_CALL

#define MQ_CALLBACK_FACTORY_CTOR_CALL   MQ_RT_CALL tmpl, create, fct, contextP

Definition at line 3064 of file LibMqMsgque_mq.h.

◆ 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 3036 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
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

Definition at line 2965 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 3097 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 3089 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 None in MqContextCreate to garantee a one time execution of this code

Definition at line 3079 of file LibMqMsgque_mq.h.