Loading...
Searching...
No Matches
MqContextC_Env_CC_API

MqContextC - protect and restore the service-environment … More...

+ Collaboration diagram for MqContextC_Env_CC_API:

Functions

void ccmqmsgque::MqContextC::EnvProtect ()
  C++: ctx.EnvProtect() C-API
protect the service-environment
 
void ccmqmsgque::MqContextC::EnvRestore ()
  C++: ctx.EnvRestore() C-API
restore the service-environment
 

Detailed Description

MqContextC - protect and restore the service-environment …

The "Env" style functions are used to secure the service-environment (defined in MqEnvS)
and is required.. under special conditions... to proper answer the original service call at the
end of the service-processing.
By default ccmqmsgque guarantee the proper management of the environment on behalf of the user.
Under normal conditions the user don't need these functions.

The folllowing design-goals were defined:

The two design-goals from above are in conflict and the both functions MqEnvProtect and MqEnvRestore are used to solve this conflict.

Example from server.cc protect the environment and import from database

            // PROTECT the original service-call
            EnvProtect();
            // OVERWRITE the original service-call with data from the database
            dump->Import(this);
            MkBufferListC read = ReadALL();
            // RESTORE the original service-call
            EnvRestore();
            // ANSWER the original service-call
            Send("R", "L", read);

The "Env" style functions are used to secure the service-environment (defined in MqEnvS)
and is required.. under special conditions... to proper answer the original service call at the
end of the service-processing.
By default ccmqmsgque guarantee the proper management of the environment on behalf of the user.
Under normal conditions the user don't need these functions.

The folllowing design-goals were defined:

The two design-goals from above are in conflict and the both functions MqEnvProtect and MqEnvRestore are used to solve this conflict.

Example from server.cc protect the environment and import from database

            // PROTECT the original service-call
            EnvProtect();
            // OVERWRITE the original service-call with data from the database
            dump->Import(this);
            MkBufferListC read = ReadALL();
            // RESTORE the original service-call
            EnvRestore();
            // ANSWER the original service-call
            Send("R", "L", read);

Function Documentation

◆ EnvProtect()

void ccmqmsgque::MqContextC::EnvProtect ( )
inline

C++: ctx.EnvProtect() C-API
protect the service-environment

Definition at line 724 of file MqContextC_inline_cc.hh.

724 {
725 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
726 MkRtSetup_X(ctx);
727 MqEnvProtect(ctx);
728 }
#define MK_NULL_NO
#define MK_UNUSED
#define MkRtSetup_X(x)
MQ_CTX getCTX(bool nullB=MK_NULL_NO) const
return the LibMsgqueObject from current MqContextC instance
#define MqEnvProtect(...)

◆ EnvRestore()

void ccmqmsgque::MqContextC::EnvRestore ( )
inline

C++: ctx.EnvRestore() C-API
restore the service-environment

Definition at line 731 of file MqContextC_inline_cc.hh.

731 {
732 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
733 MkRtSetup_X(ctx);
734 MqEnvRestore(ctx);
735 }
MQ_EXTERN void MqEnvRestore(MQ_CTX ctx) MK_ATTR_HDL
restore the service-environment