maxon.DataDictionaryObjectInterface¶
Description¶
Class to store and find any maxon.Data
type under any type of key.
Warning
Methods Signature¶
|
Removes a data entry from the dictionary. |
|
Gets the value for the given key in the dictionary.
|
|
Gets data stored under a specific id. |
|
Checks if the dictionary is empty. |
|
Frees the entire dictionary. |
|
Sets a value for the given key in the dictionary.
|
|
Sets |
Methods Definition¶
-
DataDictionaryObjectInterface.
EraseData
(key)¶ Removes a data entry from the dictionary.
Warning
This function doesn’t check if the dictionary contained the key.
-
DataDictionaryObjectInterface.
Get
(key, defaultValue=None)¶ - Gets the value for the given key in the dictionary.A value can be retrieved in two ways:
Using a FId: dict.Get(maxon.MAXCHINEINFO.COMPUTERNAME)
Using a registered data type: dict.Get<String>(Int32(5))
- Parameters
key (
maxon.Data
) – Key under which the data is stored.defaultValue (
maxon.Data
.) – Default value which should be returned if the key cannot be found.
- Raises
KeyError – When the given key does not exist.
- Returns
maxon.Data
converted to the right type if found in the dictionary, otherwise the default value.
-
DataDictionaryObjectInterface.
GetData
(key)¶ Gets data stored under a specific id.
- Parameters
- Returns
maxon.Data
asmaxon.Data
class.- Return type
-
DataDictionaryObjectInterface.
IsEmpty
()¶ Checks if the dictionary is empty.
- Returns
True if the dictionary does not contain any elements.
- Return type
bool
-
DataDictionaryObjectInterface.
Reset
()¶ Frees the entire dictionary. After this call the DataDictionary is empty.
-
DataDictionaryObjectInterface.
Set
(key, value)¶ - Sets a value for the given key in the dictionary.A value can be set in two ways:
Using a FId: dict.Set(maxon.MAXCHINEINFO.COMPUTERNAME, “data”)
Using an registered data type: dict.Set(maxon.Int32(5), “data”)
- Parameters
key (
maxon.Data
) –maxon.Id
under which the data is stored.value (
maxon.Data
) – Move reference to the data.
-
DataDictionaryObjectInterface.
SetData
(key, value)¶ Sets
maxon.Data
under a specific id.- Parameters
value (
maxon.Data
) – Move reference to the data.