About
A maxon::DataDictionary is a data container that stores arbitrary MAXON API data filed under a given key. The base interface is maxon::DataDictionaryInterface.
- Note
- For custom interfaces inheriting maxon::DataDictionary functionality use maxon::DataDictionaryObjectInterface.
Creation
A new maxon::DataDictionary object can be created on the stack:
maxon::DataDictionary dataDict;
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:176
#define iferr_return
Definition: resultbase.h:1465
Keys and Values
A DataDictionary stores data for one or many keys. Both the stored data and the key must be a registered MAXON API data type (see MAXON Data Type).
- Note
- To access data with a defined type one can use resource IDs, see Resource IDs.
PyObject * value
Definition: abstract.h:715
Definition: datatypebase.h:1800
Definition: datatypebase.h:1199
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
The data stored in the DataDictionary can be inspected and deleted with:
if (dataDict.Contains(
key))
{
}
if (!dataDict.Contains(
key))
PyObject * key
Definition: abstract.h:289
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:188
Iterator
Using an iterator it is simple to loop through all elements stored in the DataDictionary.
for (const auto& data : dataDict)
{
}
Definition: datatypebase.h:772
Result< Data > GetCopy() const
Returns a copy of the data.
Definition: datatype.h:1194
PyObject ** type
Definition: pycore_pyerrors.h:34
Utility
Further utility functions are:
Definition: string.h:1235
void * str
Definition: bytesobject.h:77
PyObject Py_hash_t hash
Definition: dictobject.h:35
UInt64 UInt
unsigned 32/64 bit int, size depends on the platform
Definition: apibase.h:189
Further Reading