Operator Reference

get_message_objT_get_message_objGetMessageObjGetMessageObjget_message_obj (Operator)

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

Signature

get_message_obj( : ObjectData : MessageHandle, Key : )

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

void GetMessageObj(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)

static void HOperatorSet.GetMessageObj(out HObject objectData, HTuple messageHandle, HTuple key)

HObject HMessage.GetMessageObj(HTuple key)

HObject HMessage.GetMessageObj(string key)

def get_message_obj(message_handle: HHandle, key: Union[str, int]) -> HObject

Description

get_message_objget_message_objGetMessageObjGetMessageObjget_message_obj retrieves an object associated with the KeyKeyKeykeykey from the message denoted by the MessageHandleMessageHandleMessageHandlemessageHandlemessage_handle. The object has to be previously stored to the message using set_message_objset_message_objSetMessageObjSetMessageObjset_message_obj.

The operator returns the data in the parameter ObjectDataObjectDataObjectDataobjectDataobject_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 KeyKeyKeykeykey is not present in the message or if the data associated with the key is not an object, get_message_objget_message_objGetMessageObjGetMessageObjget_message_obj fails. Presence of keys and information about the data associated with the key can be verified using get_message_paramget_message_paramGetMessageParamGetMessageParamget_message_param.

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

ObjectDataObjectDataObjectDataobjectDataobject_data (output_object)  object(-array) objectHObjectHObjectHObjectHobject *

Tuple value retrieved from the message.

MessageHandleMessageHandleMessageHandlemessageHandlemessage_handle (input_control)  message HMessage, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Message handle.

Number of elements: MessageHandle == 1

Restriction: MessageHandle != 0

KeyKeyKeykeykey (input_control)  string HTupleUnion[str, int]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (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_objget_message_objGetMessageObjGetMessageObjget_message_obj 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.

Possible Predecessors

dequeue_messagedequeue_messageDequeueMessageDequeueMessagedequeue_message

Alternatives

get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleget_message_tuple

See also

create_messagecreate_messageCreateMessageCreateMessagecreate_message, clear_messageclear_messageClearMessageClearMessageclear_message, set_message_tupleset_message_tupleSetMessageTupleSetMessageTupleset_message_tuple, get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleget_message_tuple, set_message_objset_message_objSetMessageObjSetMessageObjset_message_obj, set_message_paramset_message_paramSetMessageParamSetMessageParamset_message_param, get_message_paramget_message_paramGetMessageParamGetMessageParamget_message_param, enqueue_messageenqueue_messageEnqueueMessageEnqueueMessageenqueue_message, dequeue_messagedequeue_messageDequeueMessageDequeueMessagedequeue_message

Module

Foundation