Skip to content

get_message_objGetMessageObjGetMessageObjget_message_objT_get_message_obj🔗

Short description🔗

get_message_objGetMessageObjGetMessageObjget_message_objT_get_message_obj — Retrieve an object associated with the key from the message.

Signature🔗

get_message_obj( out object ObjectData, message MessageHandle, string Key )void GetMessageObj( HObject* ObjectData, const HTuple& MessageHandle, const HTuple& Key )static void HOperatorSet.GetMessageObj( out HObject objectData, HTuple messageHandle, HTuple key )def get_message_obj( message_handle: HHandle, key: Union[str, int] ) -> HObject

Herror T_get_message_obj( Hobject* ObjectData, const Htuple MessageHandle, const Htuple Key )

HObject HMessage::GetMessageObj( const HTuple& Key ) const

HObject HMessage::GetMessageObj( const HString& Key ) const

HObject HMessage::GetMessageObj( const char* Key ) const

HObject HMessage::GetMessageObj( const wchar_t* Key ) const (Windows only)

HObject HMessage.GetMessageObj( HTuple key )

HObject HMessage.GetMessageObj( string key )

Description🔗

get_message_objGetMessageObj retrieves an object associated with the Keykeykey from the message denoted by the MessageHandlemessageHandlemessage_handle. The object has to be previously stored to the message using set_message_objSetMessageObj.

The operator returns the data in the parameter ObjectDataobjectDataobject_data. The iconic object is copied by the operation. Therefore, clearing or reusing the message object afterwards will not have any side-effect on the returned iconic object, afterwards.

If the given Keykeykey is not present in the message or if the data associated with the key is not an object, get_message_objGetMessageObj 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🔗

ObjectDataobjectDataobject_data (output_object) object(-array) → objectHObjectHObjectHObjectHobject *

Tuple value retrieved from the message.

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

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_obj (Image, Message, 'my_image')

Result🔗

If the operation succeeds, get_message_objGetMessageObj 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 object data associated with given key.

Combinations with other operators🔗

Combinations

Possible predecessors

dequeue_messageDequeueMessage

Alternatives

get_message_tupleGetMessageTuple

See also

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

Module🔗

Foundation