set_message_objπ
Short descriptionπ
set_message_obj β Add a key/object pair to the message.
Signatureπ
set_message_obj( object ObjectData, message MessageHandle, string Key )
Descriptionπ
set_message_obj stores an object associated with a key in the
message, which behaves as a dictionary-like data container.
The message is denoted by the MessageHandle parameter.
ObjectData is copied by the operation (copying the object data
in HALCONβs object database, see copy_obj), and can thus be
immediately reused. Both an empty object or an object tuple are considered
as a valid value that can be associated with the key.
If any data (tuple or object) was already associated with given key
(Key), the old data is destroyed by set_message_obj
and replaced by ObjectData.
The Key has to be a string or an integer.
String keys are treated case sensitive.
The object data for the given key can be retrieved again from the message
using get_message_obj.
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.
This operator modifies the state of the following input parameter:
During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.
Parametersπ
ObjectData (input_object) object(-array) β object
Object to be associated with the key.
MessageHandle (input_control, state is modified) message β (handle)
Message handle.
Number of elements: MessageHandle == 1
Restriction: MessageHandle != 0
Key (input_control) string β (string / integer)
Key string or integer.
Number of elements: Key == 1
Exampleπ
(HDevelop)
create_message (Message)
read_image( Image, 'filename')
set_message_obj (Image, Message, 'my_image')
Resultπ
If the operation succeeds, set_message_tuple returns 2 (H_MSG_TRUE).
Otherwise an exception is raised. Possible error conditions include
invalid parameters (handle or key) or resource allocation error.
Combinations with other operatorsπ
Combinations
Possible predecessors
Possible successors
enqueue_message, set_message_tuple
Alternatives
See also
create_message, clear_message, set_message_tuple, get_message_tuple, get_message_obj, set_message_param, get_message_param, enqueue_message, dequeue_message
Moduleπ
Foundation