libmqmsgque 9.0
Loading...
Searching...
No Matches
Modules | Data Structures | Macros | Typedefs
MqFactoryC_C_API

The MqFactoryC object known as fct or factory is used to provide an interface to create one or more new MqContextCMore...

+ Collaboration diagram for MqFactoryC_C_API:

Modules

 MqFactoryC_TOR_C_API
 various functions to create, initialize and destroy a MqFactoryC
 
 MqFactoryC_Get_C_API
 various functions to 'get' data out of a MqFactoryC
 
 MqFactoryC_Misc_C_API
 various functions to work on a MqFactoryC
 
 MqFactoryC_Introspection_C_API
 Get information about all instances created by class
 
 MqFactoryC_Cast_C_API
 cast from defined and undefined instance to MqFactoryC
 

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)   if (fct == NULL) MkPanicC(MK_ERROR_PANIC, __func__, -1, "MqFactoryS exception");
 
#define MQ_CALLBACK_FACTORY_CTOR_ARGS
 the MqFactoryCTorF arguments with default names
 

Typedefs

typedef enum MkErrorE(* MqFactoryCTorF) (MQ_RT const 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 const mkrt, MQ_CTX ctx, bool doFactoryCleanup, MQ_FCT const fct)
 type of a MqFactoryC destructor
 
typedef void(* MqFactoryDataFreeF) (MK_RT const mkrt, MK_PTR *dataP)
 prototype for a free additional factory data function
 
typedef void(* MqFactoryDataCopyF) (MK_RT const mkrt, MK_PTR *dataP)
 prototype for a copy additional factory data function
 

MqFactoryC


typedef struct MqFactorySMQ_FCT
 class-shortcut for struct MqFactoryS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MqFactorySMQ_FCTN
 class-shortcut for const struct MqFactoryS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MqFactoryS MQ_FCTR
 reference-shortcut for struct MqFactoryS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MqFactoryC type definition

typedef struct MqFactoryS MqFactoryCR
 instance-struct-reference same as struct MqFactoryS, useable in a class-macro as: class##R
 
typedef const struct MqFactoryS MqFactoryCNR
 const instance-struct-reference same as const struct MqFactoryS, useable in a class-macro as: class##R
 
#define MqFactoryC_T   (&MQ_RT_REF._MqFactoryC_T)
 instance-type as specific-instance-type, useable in a class-macro as: class##_T
 
#define MqFactoryC_TT   (MkTYP(MqFactoryC_T))
 instance-type as common-instance-type, useable in a class-macro as: class##_TT
 
#define MqFactoryST   MqFactoryC_T
 instance-type as specific-instance-type
 
#define MqFactorySTT   (MkTYP(MqFactoryST))
 instance-type as common-instance-type (cast from MqFactoryST into MkTypeS) …
 
#define MqFactoryC_type   MQ_FCT
 same as MqFactoryS but useable in a class-macro as: class##_type
 
#define MqFactoryCT_X(instance)   ( (struct MkDefTypeS *) (MkOBJ_R(instance).type) )
 cast from an instance into the specific-instance-type
 
#define MqFactoryCTT_X(instance)   (MkOBJ_R(instance).type)
 cast from an instance into the common-instance-type
 
#define MqFactoryCT_TT(typ)   ( (struct MkDefTypeS *) (typ) )
 cast from an common-instance-type into an specific-instance-type
 
#define MqFactoryC_NS   MQ
 map class to namespace …
 
#define MqFactoryCTT   MqFactoryCTT
 instance-type as common-instance-type for MqFactoryC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)
 
#define MqFactoryCT   ( (struct MkDefTypeS *) MqFactoryCTT )
 instance-type as specific-instance-type for MqFactoryC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)
 

MqFactoryC signature check

bool MqFctCheck (MK_MNGN mng)
 check MqFactoryS%->Mk{ObjectS::signature} …
 
#define MqFactoryC_Check(mng)   MqFctCheck(mng)
 

MqFactoryC signature define

#define MqFactoryC_SIGNATURE   (MkObjectC_SIGNATURE ^ (15u<<10))
 
#define MqFactoryC_MASK   (((1u<<22)-1)<<10)
 

MqFactoryC cast to superclass

#define MqFactoryC_X2fct(x)   (x)
 
#define MqFactoryC_X2obj(x)   MkOBJ(x)
 

Detailed Description

The MqFactoryC object 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_CTX const tmpl, \
struct MqFactoryS * const fct, \
#define MqFactoryCT
instance-type as specific-instance-type for MqFactoryC in the target-programming-language (C,...
Definition msgque_mq.h:3071
MqFactoryE
the factory is called to create an object for ...
Definition msgque_mq.h:1432
PUBLIC data structure for the libmqmsgque-specific-data
Definition msgque_mq.h:3804
data used to define a factory
Definition msgque_mq.h:3005

the MqFactoryCTorF arguments with default names

Definition at line 2939 of file msgque_mq.h.

◆ MqFactoryC_Check

#define MqFactoryC_Check (   mng)    MqFctCheck(mng)

Definition at line 3091 of file msgque_mq.h.

◆ MqFactoryC_MASK

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

Definition at line 3028 of file msgque_mq.h.

◆ MqFactoryC_NS

#define MqFactoryC_NS   MQ

map class to namespace …

Definition at line 3067 of file msgque_mq.h.

◆ MqFactoryC_SIGNATURE

#define MqFactoryC_SIGNATURE   (MkObjectC_SIGNATURE ^ (15u<<10))

Definition at line 3027 of file msgque_mq.h.

◆ MqFactoryC_T

#define MqFactoryC_T   (&MQ_RT_REF._MqFactoryC_T)

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

Definition at line 3051 of file msgque_mq.h.

◆ MqFactoryC_TT

#define MqFactoryC_TT   (MkTYP(MqFactoryC_T))

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

Definition at line 3053 of file msgque_mq.h.

◆ MqFactoryC_type

#define MqFactoryC_type   MQ_FCT

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

Definition at line 3059 of file msgque_mq.h.

◆ MqFactoryC_X2fct

#define MqFactoryC_X2fct (   x)    (x)

Definition at line 3036 of file msgque_mq.h.

◆ MqFactoryC_X2obj

#define MqFactoryC_X2obj (   x)    MkOBJ(x)

Definition at line 3037 of file msgque_mq.h.

◆ MqFactoryCT

#define MqFactoryCT   ( (struct MkDefTypeS *) MqFactoryCTT )

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

Definition at line 3071 of file msgque_mq.h.

◆ MqFactoryCT_TT

#define MqFactoryCT_TT (   typ)    ( (struct MkDefTypeS *) (typ) )

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

Definition at line 3065 of file msgque_mq.h.

◆ MqFactoryCT_X

#define MqFactoryCT_X (   instance)    ( (struct MkDefTypeS *) (MkOBJ_R(instance).type) )

cast from an instance into the specific-instance-type

Definition at line 3061 of file msgque_mq.h.

◆ MqFactoryCTT

#define MqFactoryCTT   MqFactoryCTT

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

Definition at line 3069 of file msgque_mq.h.

◆ MqFactoryCTT_X

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

cast from an instance into the common-instance-type

Definition at line 3063 of file msgque_mq.h.

◆ MqFactoryPanic

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

Definition at line 2919 of file msgque_mq.h.

◆ MqFactoryST

#define MqFactoryST   MqFactoryC_T

instance-type as specific-instance-type

Definition at line 3055 of file msgque_mq.h.

◆ MqFactorySTT

#define MqFactorySTT   (MkTYP(MqFactoryST))

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

Definition at line 3057 of file msgque_mq.h.

Typedef Documentation

◆ MQ_FCT

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

Definition at line 557 of file msgque_mq.h.

◆ MQ_FCTN

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

Definition at line 560 of file msgque_mq.h.

◆ MQ_FCTR

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

Definition at line 563 of file msgque_mq.h.

◆ MqFactoryCNR

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

Definition at line 3049 of file msgque_mq.h.

◆ MqFactoryCR

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

Definition at line 3047 of file msgque_mq.h.

◆ MqFactoryCTorF

type of a MqFactoryC constructor

Parameters
[in]mqrtthe MqRuntimeS instance to work on - the runtime argument, use MQ_RT_CALL
[in]tmplthe calling object to initialize the configuration data using SetupDup
[in]createhow is the factory constructor used
[in]fctfactory interface in use
[out]ctx_outthe new object
Returns
set the MkErrorC to the status MK_OK, MK_CONTINUE or MK_ERROR

Definition at line 2849 of file msgque_mq.h.

◆ MqFactoryDataCopyF

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

prototype for a copy additional factory data function

Definition at line 2977 of file msgque_mq.h.

◆ MqFactoryDataFreeF

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

prototype for a free additional factory data function

Definition at line 2969 of file msgque_mq.h.

◆ MqFactoryDTorF

type of a MqFactoryC destructor

  • this callback will be called at ContextDelete to cleanup factory-related-data.
  • the ContextDelete 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 NULL in ContextCreate to garantee a one time execution of this code

Definition at line 2959 of file msgque_mq.h.

Function Documentation

◆ MqFctCheck()

bool MqFctCheck ( MK_MNGN  mng)
inline

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

Returns
TRUE on valid fct and FALSE an invalid fct

Definition at line 3086 of file msgque_mq.h.

+ Here is the caller graph for this function: