ClassesClasses | | Operators

get_message_tupleT_get_message_tupleGetMessageTupleGetMessageTuple (Operator)

Name

get_message_tupleT_get_message_tupleGetMessageTupleGetMessageTuple — Retrieve a tuple associated with the key from the message.

Signature

get_message_tuple( : : MessageHandle, Key : TupleData)

Herror T_get_message_tuple(const Htuple MessageHandle, const Htuple Key, Htuple* TupleData)

void GetMessageTuple(const HTuple& MessageHandle, const HTuple& Key, HTuple* TupleData)

HTuple HMessage::GetMessageTuple(const HString& Key) const

HTuple HMessage::GetMessageTuple(const char* Key) const

static void HOperatorSet.GetMessageTuple(HTuple messageHandle, HTuple key, out HTuple tupleData)

HTuple HMessage.GetMessageTuple(string key)

Description

get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTuple retrives a tuple associated with the KeyKeyKeyKeykey from the message denoted by the MessageHandleMessageHandleMessageHandleMessageHandlemessageHandle. The tuple has to be previously stored to the message using set_message_tupleset_message_tupleSetMessageTupleSetMessageTupleSetMessageTuple.

The operator returns the data in the parameter TupleDataTupleDataTupleDataTupleDatatupleData. The data including strings is copied by the operation, the message can thus be immediately reused.

If the given KeyKeyKeyKeykey is not present in the message or if the data associated with the key is not a tuple, get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTuple fails. Presence of keys and information about the data associated with the key can be verified using get_message_paramget_message_paramGetMessageParamGetMessageParamGetMessageParam.

Execution Information

Parameters

MessageHandleMessageHandleMessageHandleMessageHandlemessageHandle (input_control)  message HMessage, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Message handle.

Number of elements: MessageHandle == 1

Restriction: MessageHandle != 0

KeyKeyKeyKeykey (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Key string.

Number of elements: Key == 1

Restriction: length(Key) > 0

TupleDataTupleDataTupleDataTupleDatatupleData (output_control)  tuple(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Tuple value retrieved from the message.

Example (HDevelop)

* ...
get_message_param (Message,'key_exists',['simple_string','foo','my_image'],\
                   KeysPresence)
get_message_param (Message,'key_data_type',['simple_string','my_image'],\
                   KeysType)
get_message_tuple (Message,'simple_string',TupleString)

Result

If the operation succeeds, get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTuple returns 2 (H_MSG_TRUE). Otherwise an exception is raised. Possible error conditions include invalid parameters (handle or key), the required key not found in the message, or other than tuple data associated with given key.

Possible Predecessors

dequeue_messagedequeue_messageDequeueMessageDequeueMessageDequeueMessage

Alternatives

get_message_objget_message_objGetMessageObjGetMessageObjGetMessageObj

See also

create_messagecreate_messageCreateMessageCreateMessageCreateMessage, clear_messageclear_messageClearMessageClearMessageClearMessage, set_message_tupleset_message_tupleSetMessageTupleSetMessageTupleSetMessageTuple, set_message_objset_message_objSetMessageObjSetMessageObjSetMessageObj, get_message_objget_message_objGetMessageObjGetMessageObjGetMessageObj, set_message_paramset_message_paramSetMessageParamSetMessageParamSetMessageParam, get_message_paramget_message_paramGetMessageParamGetMessageParamGetMessageParam, enqueue_messageenqueue_messageEnqueueMessageEnqueueMessageEnqueueMessage, dequeue_messagedequeue_messageDequeueMessageDequeueMessageDequeueMessage

Module

Foundation


ClassesClasses | | Operators