Skip to content

get_message_tupleGetMessageTupleGetMessageTupleget_message_tupleT_get_message_tuple🔗

Short description🔗

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

Signature🔗

get_message_tuple( message MessageHandle, string Key, out tuple TupleData )void GetMessageTuple( const HTuple& MessageHandle, const HTuple& Key, HTuple* TupleData )static void HOperatorSet.GetMessageTuple( HTuple messageHandle, HTuple key, out HTuple tupleData )def get_message_tuple( message_handle: HHandle, key: Union[str, int] ) -> Sequence[HTupleElementType]

def get_message_tuple_s( message_handle: HHandle, key: Union[str, int] ) -> HTupleElementTypeHerror T_get_message_tuple( const Htuple MessageHandle, const Htuple Key, Htuple* TupleData )

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

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

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

HTuple HMessage::GetMessageTuple( const wchar_t* Key ) const (Windows only)

HTuple HMessage.GetMessageTuple( HTuple key )

HTuple HMessage.GetMessageTuple( string key )

Description🔗

get_message_tupleGetMessageTuple retrieves a tuple associated with the Keykeykey from the message denoted by the MessageHandlemessageHandlemessage_handle. The tuple has to be previously stored to the message using set_message_tupleSetMessageTuple.

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

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

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

MessageHandlemessageHandlemessage_handle (input_control) message → (handle)HTuple (HHandle)HMessage, HTuple (IntPtr)HHandleHtuple (handle)

Message handle.

Number of elements: MessageHandle == 1
Restriction: MessageHandle != 0

Keykeykey (input_control) string → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)Union[str, int]Htuple (char* / Hlong)

Key string or integer.

Number of elements: Key == 1

TupleDatatupleDatatuple_data (output_control) tuple(-array) → (string / integer / real / handle)HTuple (HString / Hlong / double / HHandle)HTuple (string / int / long / double / HHandle)Sequence[HTupleElementType]Htuple (char* / Hlong / double / handle)

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_tupleGetMessageTuple 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.

Combinations with other operators🔗

Combinations

Possible predecessors

dequeue_messageDequeueMessage

Alternatives

get_message_objGetMessageObj

See also

create_messageCreateMessage, clear_messageClearMessage, set_message_tupleSetMessageTuple, set_message_objSetMessageObj, get_message_objGetMessageObj, set_message_paramSetMessageParam, get_message_paramGetMessageParam, enqueue_messageEnqueueMessage, dequeue_messageDequeueMessage

Module🔗

Foundation