maxon.DataDictionaryInterface¶
Description¶
Class to store and find any data type under any type of key.
Methods Signature¶
  | 
Tests if the given key is a key of the dictionary.  | 
  | 
Erases data stored under the given key. 
 | 
  | 
Gets the value for the given key in the dictionary. 
 | 
  | 
Returns the number of entries in the dictionary.  | 
  | 
Helper functions for initialize an iterator.  | 
  | 
Checks if the dictionary is empty.  | 
Checks if the dictionary contains anything.  | 
|
  | 
Frees the entire dictionary.  | 
  | 
Sets a value for the given key in the dictionary. 
 | 
Methods Definition¶
- 
DataDictionaryInterface.Contains(key)¶ Tests if the given key is a key of the dictionary.
- Parameters
 key (
maxon.Data) – Key under which the data should be stored.- Returns
 True if existent.
- Return type
 bool
- 
DataDictionaryInterface.Erase(key)¶ - Erases data stored under the given key.Does not check if the dictionary does contain the key and can be called in two ways:
Using a FId: dict.Erase(maxon.MAXCHINEINFO.COMPUTERNAME, “data”)
Using a registered data: dict.Erase(maxon.Int32(5))
- Parameters
 key (
maxon.Data) – Key under which the data is stored.
 
- 
DataDictionaryInterface.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.Dataconverted to the right type if found in the dictionary, otherwise the default value.
 
- 
DataDictionaryInterface.GetCount()¶ Returns the number of entries in the dictionary.
- Returns
 Number of dictionary entries.
- Return type
 int
- 
DataDictionaryInterface.InitIterator(end)¶ Helper functions for initialize an iterator.
- 
DataDictionaryInterface.IsEmpty()¶ Checks if the dictionary is empty.
- Returns
 True if the dictionary does not contain any elements.
- Return type
 bool
- 
DataDictionaryInterface.IsPopulated()¶ Checks if the dictionary contains anything.
- Returns
 True if the dictionary contains any elements.
- Return type
 bool
- 
DataDictionaryInterface.Reset()¶ Frees the entire dictionary. After this call the DataDictionary is empty.
- 
DataDictionaryInterface.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.Idunder which the data is stored.value (
maxon.Data) – Move reference to the data.