maxon.DataDictionaryObjectInterface

Description

Class to store and find any maxon.Data type under any type of key.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to deal with this function.

Methods Signature

EraseData(key)

Removes a data entry from the dictionary.

Get(key[, defaultValue])

Gets the value for the given key in the dictionary.

GetData(key)

Gets data stored under a specific id.

IsEmpty()

Checks if the dictionary is empty.

Reset()

Frees the entire dictionary.

Set(key, value)

Sets a value for the given key in the dictionary.

SetData(key, value)

Sets maxon.Data under a specific id.

Methods Definition

DataDictionaryObjectInterface.EraseData(key)

Removes a data entry from the dictionary.

Warning

This function doesn’t check if the dictionary contained the key.

Parameters

key (maxon.Id) – maxon.Id under which the data is stored.

DataDictionaryObjectInterface.Get(key, defaultValue=None)
Gets the value for the given key in the dictionary.

A value can be retrieved in two ways:
  1. Using a FId: dict.Get(maxon.MAXCHINEINFO.COMPUTERNAME)

  2. 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

key (maxon.Id) – maxon.Id under which the data is stored.

Returns

maxon.Data as maxon.Data class.

Return type

maxon.Data

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:
  1. Using a FId: dict.Set(maxon.MAXCHINEINFO.COMPUTERNAME, “data”)

  2. Using an registered data type: dict.Set(maxon.Int32(5), “data”)

Parameters
DataDictionaryObjectInterface.SetData(key, value)

Sets maxon.Data under a specific id.

Parameters