get_dict_objectT_get_dict_objectGetDictObjectGetDictObjectget_dict_object (Operator)
Name
get_dict_objectT_get_dict_objectGetDictObjectGetDictObjectget_dict_object
— Retrieve an object associated with the key from the dictionary.
Signature
def get_dict_object(dict_handle: HHandle, key: Union[str, int]) -> HObject
Description
get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object
retrieves an object associated with the KeyKeyKeyKeykeykey
from the dictionary denoted by the DictHandleDictHandleDictHandleDictHandledictHandledict_handle
.
The object has to be previously stored to the dictionary using
set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object
.
The operator returns the data in the parameter ObjectObjectObjectObjectobjectValobject
. The
iconic object is copied by the operation. Therefore, clearing or reusing
the dictionary object afterwards will not have any side-effect on the
returned iconic object.
If the given KeyKeyKeyKeykeykey
is not present in the dictionary or if the data
associated with the key is not an object, get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object
fails.
Presence of keys and information about the data associated with the key can
be verified using get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_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
ObjectObjectObjectObjectobjectValobject
(output_object) object(-array) →
objectHObjectHObjectHObjectHobject *
Object value retrieved from the dictionary.
DictHandleDictHandleDictHandleDictHandledictHandledict_handle
(input_control) dict →
HDict, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Dictionary handle.
Number of elements: DictHandle == 1
KeyKeyKeyKeykeykey
(input_control) string →
HTupleUnion[str, int]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)
Key string.
Number of elements: Key == 1
Restriction: length(Key) > 0
Example (HDevelop)
* ...
get_dict_param (Dict, 'key_exists', ['simple_string','foo','my_image'], \
KeysPresence)
get_dict_param (Dict, 'key_data_type', ['simple_string','my_image'], \
KeysType)
get_dict_object (Image, Dict, 'my_image')
Result
If the operation succeeds, get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object
returns TRUE.
Otherwise an exception is raised. Possible error conditions include
invalid parameters (handle or key), the required key not found in the
dictionary or other than object data associated with given key.
Possible Predecessors
set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object
Possible Successors
get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object
Alternatives
get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple
See also
create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict
,
set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple
,
get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple
,
set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object
,
remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyRemoveDictKeyremove_dict_key
,
get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param
Module
Foundation