get_message_paramT_get_message_paramGetMessageParamGetMessageParamget_message_param (算子)
名称
get_message_paramT_get_message_paramGetMessageParamGetMessageParamget_message_param — 查询消息参数或消息相关信息。
签名
def get_message_param(message_handle: HHandle, gen_param_name: str, key: MaybeSequence[Union[str, int]]) -> Sequence[Union[int, float, str]]
def get_message_param_s(message_handle: HHandle, gen_param_name: str, key: MaybeSequence[Union[str, int]]) -> Union[int, float, str]
描述
get_message_paramget_message_paramGetMessageParamGetMessageParamGetMessageParamget_message_param queries current values of message
parameters or other information about the message status.
With each call of get_message_paramget_message_paramGetMessageParamGetMessageParamGetMessageParamget_message_param, only a single parameter value
can be queried. However, there are two types of parameters/queries:
-
Parameters/queries applicable to the entire message. In this case
no keys must be specified, the parameter KeyKeyKeyKeykeykey must be an empty
tuple.
-
Parameters/queries applicable to the individual keys. In this case
a non-empty list of keys must be specified in the parameter KeyKeyKeyKeykeykey.
The keys are processed in the same order as specified in the KeyKeyKeyKeykeykey
parameter.
Key-independent (global) parameter names:
- 'message_keys'"message_keys""message_keys""message_keys""message_keys""message_keys":
Queries all the keys stored in the message, no matter whether they
are associated with tuple or object data. The list of keys is reported
as a string tuple via GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.
For this query the parameter KeyKeyKeyKeykeykey must be an empty tuple.
Currently supported key-specific parameter names are:
- 'key_exists'"key_exists""key_exists""key_exists""key_exists""key_exists":
-
Reports 1 if the given key is stored in the message, 0
otherwise.
The results are reported via GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value, one value for
each key.
- 'key_data_type'"key_data_type""key_data_type""key_data_type""key_data_type""key_data_type":
Reports 'tuple'"tuple""tuple""tuple""tuple""tuple" for keys associated with tuple data within
the message (the data can be retrieved using get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTupleget_message_tuple).
Reports 'object'"object""object""object""object""object" for keys associated with object data
(the data can be retrieved using get_message_objget_message_objGetMessageObjGetMessageObjGetMessageObjget_message_obj).
The results are reported via GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value, one value for
each key. This parameter is useful to decide dynamically whether to use
get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTupleget_message_tuple or get_message_objget_message_objGetMessageObjGetMessageObjGetMessageObjget_message_obj to get the data of a
specific key.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
MessageHandleMessageHandleMessageHandleMessageHandlemessageHandlemessage_handle (输入控制) message → HMessage, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Message handle.
元素数量:
MessageHandle == 1
限制:
MessageHandle != 0
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Names of the message parameters or info queries.
元素数量:
GenParamName == GenParamValue
默认值:
'message_keys'
"message_keys"
"message_keys"
"message_keys"
"message_keys"
"message_keys"
值列表:
'key_data_type'"key_data_type""key_data_type""key_data_type""key_data_type""key_data_type", 'key_exists'"key_exists""key_exists""key_exists""key_exists""key_exists", 'message_keys'"message_keys""message_keys""message_keys""message_keys""message_keys"
KeyKeyKeyKeykeykey (输入控制) string(-array) → HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)
Message keys the parameter/query should be applied to.
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输出控制) tuple(-array) → HTupleSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Values of the message parameters or info queries.
示例(HDevelop)
get_message_param (Message, 'message_keys', [], AllKeys)
get_message_param (Message, 'key_data_type', AllKeys, KeysType)
结果
If all the operator parameters, and the specified keys are valid,
get_message_paramget_message_paramGetMessageParamGetMessageParamGetMessageParamget_message_param 返回 2 ( H_MSG_TRUE )。否则将抛出异常。
可能的前趋
dequeue_messagedequeue_messageDequeueMessageDequeueMessageDequeueMessagedequeue_message
另见
create_messagecreate_messageCreateMessageCreateMessageCreateMessagecreate_message,
clear_messageclear_messageClearMessageClearMessageClearMessageclear_message,
set_message_tupleset_message_tupleSetMessageTupleSetMessageTupleSetMessageTupleset_message_tuple,
get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTupleget_message_tuple,
set_message_objset_message_objSetMessageObjSetMessageObjSetMessageObjset_message_obj,
get_message_objget_message_objGetMessageObjGetMessageObjGetMessageObjget_message_obj,
set_message_paramset_message_paramSetMessageParamSetMessageParamSetMessageParamset_message_param,
enqueue_messageenqueue_messageEnqueueMessageEnqueueMessageEnqueueMessageenqueue_message,
dequeue_messagedequeue_messageDequeueMessageDequeueMessageDequeueMessagedequeue_message
模块
基础