MqContextC - User friendly replacement for the MqContextC_SendApi_C_API and the MqContextC_ReadApi_C_API … More...
Functions | |
void | ccmqmsgque::MqContextC::SendVL2 (MK_STRN cstr, va_list var_list) |
C++: → C-API A version of MqSend with va_list support … | |
void | ccmqmsgque::MqContextC::SendVL2 (const std::string &cstr, va_list var_list) |
C++: → C-API A version of MqSend with va_list support … | |
MqContextC - User friendly replacement for the MqContextC_SendApi_C_API and the MqContextC_ReadApi_C_API …
User Friendly mean, replacing many lines of code by a single line of code.
The basic idea is, to use a format-signature to identify the additional command-line-arguments (args…).
The pseudo syntax is:
The following parts from the MqContextC_SendApi_C_API will be replaced by the MqContextC_HighApi_C_API
API Function | Usage |
---|---|
MqSendSTART | -> start a service call or a answer |
SendATOM | -> write a single argument into the data-package |
SendEND | -> send the service-call to the receiver |
ReadATOM | -> read a single argument from the data-package |
SendRETURN | -> answer a service call |
The replacement is defined by two parts, a High_CALL_SIGNATURE and a High_TOKEN_SIGNATURE. Both parts are strings and descripe a type or an action of a vararg argument.
Example: a typical code replacement in C looks like
and replaces the following commands...
The Call-Signature is a string of call-signature-char (CFC) starting with "E", "W", "C", "S" or "R" followed optional with "t"
CFC | Required | Reference | call-args | Default | Usage |
---|---|---|---|---|---|
E | yes | once | no | yes | MqSendEND |
W | yes | once | no | no | MqSendEND_AND_WAIT |
C | yes | once | function or service | no | MqSendEND_AND_CALLBACK |
S | yes | once | function or service | no | MqSendEND_AND_SUB |
T | yes | once | service-ident | no | MqSendEND_AND_TRANSACTION |
R | yes | once | no | no | MqSendRETURN |
t | no | W,S,T | seconds | libmkkernel::MK_TIMEOUT_USER | set the TIMEOUT |
"service-ident : send-signature @ read-signature"
and is used to identify the target-service and the required arguments.
[:] and the send-signature.ASC | MkTypeE | Usage | Number of arguments required |
---|---|---|---|
"Y" | libmkkernel::MK_I8 | MkBufferAtomU.I8 | 1 |
"O" | libmkkernel::MK_BOL | MkBufferAtomU.BOL | 1 |
"S" | libmkkernel::MK_I16 | MkBufferAtomU.I16 | 1 |
"I" | libmkkernel::MK_I32 | MkBufferAtomU.I32 | 1 |
"F" | libmkkernel::MK_FLT | MkBufferAtomU.FLT | 1 |
"W" | libmkkernel::MK_I64 | MkBufferAtomU.I64 | 1 |
"D" | libmkkernel::MK_DBL | MkBufferAtomU.DBL | 1 |
"G" | libmkkernel::MK_LONG | 32bit=I, 64bit=W | 1 |
"B" | libmkkernel::MK_BIN | MkBufferU.B | 1 -> MkBinaryR reference |
"C" | libmkkernel::MK_STR | MkBufferU.C | 1 |
"U" | libmkkernel::MK_BUF | MkBufferC . | 1 -> typeless Buffer able to hold every kind of data |
"L" | libmkkernel::MK_BFL | MkBufferListC . | 1 -> list of MkBufferC . |
"." | libmkkernel::MK_BUF | MkBufferC . | 1 -> READ ONLY - like 'U' but return the Buffer-Value and not the MkBufferC . |
"*" | libmkkernel::MK_BFL | MkBufferListC . | 1 -> READ ONLY - like 'L' but collect ALL remaining data as ONE MkBufferListC . |
"[" | MqSendL_START | 0 -> Start of List | |
"]" | MqSendL_END | 0 -> End of List | |
"(" | MqSendT_START | 0 -> Start of Transaction Object, only as FIRST parameter | |
")" | MqSendT_END | 0 -> End of Transaction Object, only ONE supported | |
":" | END of SERVICE-IDENT | * -> next SEND_SIGNATURE | |
"@" | END of SEND-SIGN. | * -> next READ-SIGNATURE |
Example from server.cc
→ in a service-call send the server-configuratien back to the client
void CNFG () { SendSTART(); SendBOL(ConfigGetIsServer()); SendBOL(LinkIsParent()); SendBOL(SlaveIs()); SendBOL(ConfigGetIsString()); SendBOL(MkRuntimeC::GetIsSilent()); SendBOL(LinkIsConnected()); SendSTR(ConfigGetName()); SendI32(MkRuntimeC::GetDebug()); SendI32(LinkGetCtxId()); SendSTR(ServiceTokenGet()); SendRETURN(); }
User Friendly mean, replacing many lines of code by a single line of code.
The basic idea is, to use a format-signature to identify the additional command-line-arguments (args…).
The pseudo syntax is:
The following parts from the MqContextC_SendApi_C_API will be replaced by the MqContextC_HighApi_C_API
API Function | Usage |
---|---|
MqSendSTART | -> start a service call or a answer |
SendATOM | -> write a single argument into the data-package |
SendEND | -> send the service-call to the receiver |
ReadATOM | -> read a single argument from the data-package |
SendRETURN | -> answer a service call |
The replacement is defined by two parts, a High_CALL_SIGNATURE and a High_TOKEN_SIGNATURE. Both parts are strings and descripe a type or an action of a vararg argument.
Example: a typical code replacement in C looks like
and replaces the following commands...
The Call-Signature is a string of call-signature-char (CFC) starting with "E", "W", "C", "S" or "R" followed optional with "t"
CFC | Required | Reference | call-args | Default | Usage |
---|---|---|---|---|---|
E | yes | once | no | yes | MqSendEND |
W | yes | once | no | no | MqSendEND_AND_WAIT |
C | yes | once | function or service | no | MqSendEND_AND_CALLBACK |
S | yes | once | function or service | no | MqSendEND_AND_SUB |
T | yes | once | service-ident | no | MqSendEND_AND_TRANSACTION |
R | yes | once | no | no | MqSendRETURN |
t | no | W,S,T | seconds | libmkkernel::MK_TIMEOUT_USER | set the TIMEOUT |
"service-ident : send-signature @ read-signature"
and is used to identify the target-service and the required arguments.
[:] and the send-signature.ASC | MkTypeE | Usage | Number of arguments required |
---|---|---|---|
"Y" | libmkkernel::MK_I8 | MkBufferAtomU.I8 | 1 |
"O" | libmkkernel::MK_BOL | MkBufferAtomU.BOL | 1 |
"S" | libmkkernel::MK_I16 | MkBufferAtomU.I16 | 1 |
"I" | libmkkernel::MK_I32 | MkBufferAtomU.I32 | 1 |
"F" | libmkkernel::MK_FLT | MkBufferAtomU.FLT | 1 |
"W" | libmkkernel::MK_I64 | MkBufferAtomU.I64 | 1 |
"D" | libmkkernel::MK_DBL | MkBufferAtomU.DBL | 1 |
"G" | libmkkernel::MK_LONG | 32bit=I, 64bit=W | 1 |
"B" | libmkkernel::MK_BIN | MkBufferU.B | 1 -> MkBinaryR reference |
"C" | libmkkernel::MK_STR | MkBufferU.C | 1 |
"U" | libmkkernel::MK_BUF | MkBufferC . | 1 -> typeless Buffer able to hold every kind of data |
"L" | libmkkernel::MK_BFL | MkBufferListC . | 1 -> list of MkBufferC . |
"." | libmkkernel::MK_BUF | MkBufferC . | 1 -> READ ONLY - like 'U' but return the Buffer-Value and not the MkBufferC . |
"*" | libmkkernel::MK_BFL | MkBufferListC . | 1 -> READ ONLY - like 'L' but collect ALL remaining data as ONE MkBufferListC . |
"[" | MqSendL_START | 0 -> Start of List | |
"]" | MqSendL_END | 0 -> End of List | |
"(" | MqSendT_START | 0 -> Start of Transaction Object, only as FIRST parameter | |
")" | MqSendT_END | 0 -> End of Transaction Object, only ONE supported | |
":" | END of SERVICE-IDENT | * -> next SEND_SIGNATURE | |
"@" | END of SEND-SIGN. | * -> next READ-SIGNATURE |
Example from server.cc
→ in a service-call send the server-configuratien back to the client
void CNFG () { SendSTART(); SendBOL(ConfigGetIsServer()); SendBOL(LinkIsParent()); SendBOL(SlaveIs()); SendBOL(ConfigGetIsString()); SendBOL(MkRuntimeC::GetIsSilent()); SendBOL(LinkIsConnected()); SendSTR(ConfigGetName()); SendI32(MkRuntimeC::GetDebug()); SendI32(LinkGetCtxId()); SendSTR(ServiceTokenGet()); SendRETURN(); }
User Friendly mean, replacing many lines of code by a single line of code.
The basic idea is, to use a format-signature to identify the additional command-line-arguments (args…).
The pseudo syntax is:
The following parts from the MqContextC_SendApi_C_API will be replaced by the MqContextC_HighApi_C_API
API Function | Usage |
---|---|
MqSendSTART | -> start a service call or a answer |
SendATOM | -> write a single argument into the data-package |
SendEND | -> send the service-call to the receiver |
ReadATOM | -> read a single argument from the data-package |
SendRETURN | -> answer a service call |
The replacement is defined by two parts, a High_CALL_SIGNATURE and a High_TOKEN_SIGNATURE. Both parts are strings and descripe a type or an action of a vararg argument.
Example: a typical code replacement in C looks like
and replaces the following commands...
The Call-Signature is a string of call-signature-char (CFC) starting with "E", "W", "C", "S" or "R" followed optional with "t"
CFC | Required | Reference | call-args | Default | Usage |
---|---|---|---|---|---|
E | yes | once | no | yes | MqSendEND |
W | yes | once | no | no | MqSendEND_AND_WAIT |
C | yes | once | function or service | no | MqSendEND_AND_CALLBACK |
S | yes | once | function or service | no | MqSendEND_AND_SUB |
T | yes | once | service-ident | no | MqSendEND_AND_TRANSACTION |
R | yes | once | no | no | MqSendRETURN |
t | no | W,S,T | seconds | libmkkernel::MK_TIMEOUT_USER | set the TIMEOUT |
"service-ident : send-signature @ read-signature"
and is used to identify the target-service and the required arguments.
[:] and the send-signature.ASC | MkTypeE | Usage | Number of arguments required |
---|---|---|---|
"Y" | libmkkernel::MK_I8 | MkBufferAtomU.I8 | 1 |
"O" | libmkkernel::MK_BOL | MkBufferAtomU.BOL | 1 |
"S" | libmkkernel::MK_I16 | MkBufferAtomU.I16 | 1 |
"I" | libmkkernel::MK_I32 | MkBufferAtomU.I32 | 1 |
"F" | libmkkernel::MK_FLT | MkBufferAtomU.FLT | 1 |
"W" | libmkkernel::MK_I64 | MkBufferAtomU.I64 | 1 |
"D" | libmkkernel::MK_DBL | MkBufferAtomU.DBL | 1 |
"G" | libmkkernel::MK_LONG | 32bit=I, 64bit=W | 1 |
"B" | libmkkernel::MK_BIN | MkBufferU.B | 1 -> MkBinaryR reference |
"C" | libmkkernel::MK_STR | MkBufferU.C | 1 |
"U" | libmkkernel::MK_BUF | MkBufferC . | 1 -> typeless Buffer able to hold every kind of data |
"L" | libmkkernel::MK_BFL | MkBufferListC . | 1 -> list of MkBufferC . |
"." | libmkkernel::MK_BUF | MkBufferC . | 1 -> READ ONLY - like 'U' but return the Buffer-Value and not the MkBufferC . |
"*" | libmkkernel::MK_BFL | MkBufferListC . | 1 -> READ ONLY - like 'L' but collect ALL remaining data as ONE MkBufferListC . |
"[" | MqSendL_START | 0 -> Start of List | |
"]" | MqSendL_END | 0 -> End of List | |
"(" | MqSendT_START | 0 -> Start of Transaction Object, only as FIRST parameter | |
")" | MqSendT_END | 0 -> End of Transaction Object, only ONE supported | |
":" | END of SERVICE-IDENT | * -> next SEND_SIGNATURE | |
"@" | END of SEND-SIGN. | * -> next READ-SIGNATURE |
Example from server.cc
→ in a service-call send the server-configuratien back to the client
void CNFG () { SendSTART(); SendBOL(ConfigGetIsServer()); SendBOL(LinkIsParent()); SendBOL(SlaveIs()); SendBOL(ConfigGetIsString()); SendBOL(MkRuntimeC::GetIsSilent()); SendBOL(LinkIsConnected()); SendSTR(ConfigGetName()); SendI32(MkRuntimeC::GetDebug()); SendI32(LinkGetCtxId()); SendSTR(ServiceTokenGet()); SendRETURN(); }
|
inline |
C++:
→ C-API ctx.SendVL2(MK_STRN cstr, va_list var_list)
A version of MqSend with va_list support …
Definition at line 810 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.SendVL2(MK_STRN cstr, va_list var_list)
A version of MqSend with va_list support …
Definition at line 802 of file MqContextC_inline_cc.hh.