Loading...
Searching...
No Matches
MqContextC_ProxyApi_C_API

MqContextC - copy data from the read-data-package of the sourceCtx to the send-data-package of the targetCtx More...

+ Collaboration diagram for MqContextC_ProxyApi_C_API:

Functions

MQ_EXTERN enum MkErrorE libmqmsgque::MqProxyItem_RT (MK_RT const mkrt, MQ_CTX const sourceCtx, MQ_CTX const targetCtx)
 Copy a single-data-item from the sourceCtx to the targetCtx.
 
MQ_EXTERN enum MkErrorE libmqmsgque::MqProxyPackage_RT (MK_RT const mkrt, MQ_CTX const sourceCtx, MQ_CTX const targetCtx, MQ_DMP const dump)
 copy all package-items from the sourceCtx to the targetCtx
 
MQ_EXTERN enum MkErrorE libmqmsgque::MqProxyForward_RT (MK_RT const mkrt, MQ_CTX const sourceCtx, MQ_CTX const targetCtx, MQ_DMP const dump, MK_TIME_T const timeout)
 send the entire read-data-package-data to the link-target
 

MqContextC - MqContextC_ProxyApi_Proxy_C_API - overload

#define MqProxyForward_NULL(...)
 
#define MqProxyForward(...)
 
#define MqProxyForward_3(sourceCtx, targetCtx, dump)
 
#define MqProxyForward_2(sourceCtx, targetCtx)
 
#define MqProxyForward_E(...)
 
#define MqProxyForward_C(...)
 
#define MqProxyItem_NULL(...)
 
#define MqProxyItem(...)
 
#define MqProxyItem_E(...)
 
#define MqProxyItem_C(...)
 
#define MqProxyPackage_NULL(...)
 
#define MqProxyPackage(...)
 
#define MqProxyPackage_2(sourceCtx, targetCtx)
 
#define MqProxyPackage_E(...)
 
#define MqProxyPackage_C(...)
 

Detailed Description

MqContextC - copy data from the read-data-package of the sourceCtx to the send-data-package of the targetCtx

The proxy-feature is used in a filter-setup to process-and-forward incoming data.

See also
MqDumpC

Example: A typical proxy-setup in pseudo C++ code

void myService () {
MqContextC *ftr = SlaveGetFilter(); // get the "slave" with id "1" (the filter)
...
ftr->SendSTART(); // start the FORWARD
while (ReadItemExists()) { // read ALL data from the ORIGINAL service-call
ProxyItem(ftr); // forward a SINGEL item from "this" to "ftr"
}
...
ftr->SendEND_AND_WAIT("MYTK"); // send the data.package to "ftr"
...
SendSTART(); // start the ANSWER
while (ftr->ReadItemExists()) { // read ALL data from the "MYTK" service-call
ftr->ProxyItem(this); // forward a SINGEL item from "ftr" to "this"
}
SendRETURN(); // answer the ORIGINAL service call
}
MK_BOOL ReadItemExists() const

Macro Definition Documentation

◆ MqProxyForward

#define MqProxyForward ( ...)
Value:
MqProxyForward_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 334 of file msgque_overload_mq.h.

◆ MqProxyForward_2

#define MqProxyForward_2 ( sourceCtx,
targetCtx )
Value:
MqProxyForward(sourceCtx,targetCtx,NULL,MK_TIMEOUT_DEFAULT)
#define MqProxyForward(...)

Definition at line 336 of file msgque_overload_mq.h.

◆ MqProxyForward_3

#define MqProxyForward_3 ( sourceCtx,
targetCtx,
dump )
Value:
MqProxyForward(sourceCtx,targetCtx,dump,MK_TIMEOUT_DEFAULT)

Definition at line 335 of file msgque_overload_mq.h.

◆ MqProxyForward_C

#define MqProxyForward_C ( ...)
Value:
if (MkErrorCheckI(MqProxyForward(__VA_ARGS__)))

Definition at line 338 of file msgque_overload_mq.h.

◆ MqProxyForward_E

#define MqProxyForward_E ( ...)
Value:
MkErrorCheck(MqProxyForward(__VA_ARGS__))

Definition at line 337 of file msgque_overload_mq.h.

◆ MqProxyForward_NULL

#define MqProxyForward_NULL ( ...)
Value:
MqProxyForward_RT(MK_RT_CALL_NULL __VA_ARGS__)
#define MK_RT_CALL_NULL

Definition at line 333 of file msgque_overload_mq.h.

◆ MqProxyItem

#define MqProxyItem ( ...)
Value:
MqProxyItem_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 340 of file msgque_overload_mq.h.

◆ MqProxyItem_C

#define MqProxyItem_C ( ...)
Value:
if (MkErrorCheckI(MqProxyItem(__VA_ARGS__)))
#define MqProxyItem(...)

Definition at line 342 of file msgque_overload_mq.h.

◆ MqProxyItem_E

#define MqProxyItem_E ( ...)
Value:
MkErrorCheck(MqProxyItem(__VA_ARGS__))

Definition at line 341 of file msgque_overload_mq.h.

◆ MqProxyItem_NULL

#define MqProxyItem_NULL ( ...)
Value:
MqProxyItem_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 339 of file msgque_overload_mq.h.

◆ MqProxyPackage

#define MqProxyPackage ( ...)
Value:
MqProxyPackage_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 344 of file msgque_overload_mq.h.

◆ MqProxyPackage_2

#define MqProxyPackage_2 ( sourceCtx,
targetCtx )
Value:
MqProxyPackage(sourceCtx,targetCtx,NULL)
#define MqProxyPackage(...)

Definition at line 345 of file msgque_overload_mq.h.

◆ MqProxyPackage_C

#define MqProxyPackage_C ( ...)
Value:
if (MkErrorCheckI(MqProxyPackage(__VA_ARGS__)))

Definition at line 347 of file msgque_overload_mq.h.

◆ MqProxyPackage_E

#define MqProxyPackage_E ( ...)
Value:
MkErrorCheck(MqProxyPackage(__VA_ARGS__))

Definition at line 346 of file msgque_overload_mq.h.

◆ MqProxyPackage_NULL

#define MqProxyPackage_NULL ( ...)
Value:
MqProxyPackage_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 343 of file msgque_overload_mq.h.

Function Documentation

◆ MqProxyForward_RT()

MQ_EXTERN enum MkErrorE libmqmsgque::MqProxyForward_RT ( MK_RT const mkrt,
MQ_CTX const sourceCtx,
MQ_CTX const targetCtx,
MQ_DMP const dump,
MK_TIME_T const timeout )

send the entire read-data-package-data to the link-target

The goal of this function is to link two context, typically a master and a slave (filter). This function is typically used in a service or and event callback to send the entire package and wait for the answer.

Example of a typical usage in pseudo c++

void myService () {
MqContextC *ftr = SlaveGetFilter(); // get the "slave" with id "1" (the filter)
...
ProxyForward(ftr); // forward AND send the entire ENTIRE package from "this" to "ftr"
...
SendRETURN(); // answer the ORIGINAL service call
}
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sourceCtxthe source of the copy
[in,out]targetCtxthe target of the copy
[in]dumpif not MK_NULL, the value is the source of the copy, dump is the return from MqDumpExport,
[in]timeoutin seconds until a timeout-error is raised (possible values like ProcessEvent) (libmkkernel::MK_TIMEOUT_DEFAULT=libmkkernel::MK_TIMEOUT_USER)
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
See also
MqProxyItem MqServiceProxy MqServiceProxyCtx

◆ MqProxyItem_RT()

MQ_EXTERN enum MkErrorE libmqmsgque::MqProxyItem_RT ( MK_RT const mkrt,
MQ_CTX const sourceCtx,
MQ_CTX const targetCtx )

Copy a single-data-item from the sourceCtx to the targetCtx.

MqContextC - copy data from the read-data-package of the sourceCtx to the send-data-package of the targetCtx

The proxy-feature is used in a filter-setup to process-and-forward incoming data.

See also
MqDumpC

Example: A typical proxy-setup in pseudo C++ code

void myService () {
MqContextC *ftr = SlaveGetFilter(); // get the "slave" with id "1" (the filter)
...
ftr->SendSTART(); // start the FORWARD
while (ReadItemExists()) { // read ALL data from the ORIGINAL service-call
ProxyItem(ftr); // forward a SINGEL item from "this" to "ftr"
}
...
ftr->SendEND_AND_WAIT("MYTK"); // send the data.package to "ftr"
...
SendSTART(); // start the ANSWER
while (ftr->ReadItemExists()) { // read ALL data from the "MYTK" service-call
ftr->ProxyItem(this); // forward a SINGEL item from "ftr" to "this"
}
SendRETURN(); // answer the ORIGINAL service call
}
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sourceCtxthe source of the copy
[in,out]targetCtxthe target of the copy
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
See also
MqProxyForward MqServiceProxy MqServiceProxyCtx

◆ MqProxyPackage_RT()

MQ_EXTERN enum MkErrorE libmqmsgque::MqProxyPackage_RT ( MK_RT const mkrt,
MQ_CTX const sourceCtx,
MQ_CTX const targetCtx,
MQ_DMP const dump )

copy all package-items from the sourceCtx to the targetCtx

This operation is different from MqProxyForward because MqSendSTART and MqSendEND etc is missing. The advantage of this command is that additional items can be added.

Example of a typical usage in pseudo c++

void myService () {
MqContextC *ftr = SlaveGetFilter(); // get the "slave" with id "1" (the filter)
...
ftr->SendSTART(); // start the FORWARD
ProxyPackage(ftr); // forward the ENTIRE package-data from "this" to "ftr"
...
ftr->SendEND_AND_WAIT("MYTK"); // send the data.package to "ftr"
...
SendSTART(); // start the ANSWER
ftr->ProxyPackage(this); // forward the ENTIRE package-data from "ftr" to "this"
SendRETURN(); // answer the ORIGINAL service call
}
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sourceCtxthe source of the copy
[in,out]targetCtxthe target of the copy
[in]dumpif not MK_NULL, the value is the source of the copy, dump is the return from MqDumpExport,
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
See also
MqProxyItem MqProxyForward MqServiceProxy MqServiceProxyCtx