About
maxon::Data is a generic container that can store any Maxon API data type (MAXON Data Type). It is typically used together with a maxon::DataDictionary which stores such maxon::Data elements, see DataDictionary Manual.
Creation
A new maxon::Data object can simply be created on the stack.
if (dataType)
if (floatDataType)
{
}
Definition: datatypebase.h:1234
Result< void > Set(T &&data)
Definition: datatypebase.h:1383
Result< void > Init(const DataType &type)
Definition: datatypebase.h:770
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
#define iferr_return
Definition: resultbase.h:1531
A given maxon::Data object can be inspected and reset with:
{
}
void Reset()
Frees the wrapped data and resetd the Data object to its initial state.
Definition: datatypebase.h:1292
Bool IsEmpty() const
Definition: datatypebase.h:1269
Bool IsPopulated() const
Definition: datatypebase.h:1278
const DataType & GetType() const
Definition: datatypebase.h:1287
PyObject ** type
Definition: pycore_pyerrors.h:34
Data
The key function of maxon::Data is to store and access data stored in the object:
if (!integerType)
{
number++;
}
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY||std::is_void_v< T >, T, std::add_lvalue_reference_t< const T > >::type > Get() const
Definition: datatypebase.h:1394
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:187
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:175
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define Tuple(a0, a1, a2, a3, a4, a5, a6)
Definition: Python-ast.h:652
Definition: basearray.h:415
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append(ARG &&x)
Appends a new element at the end of the array and constructs it using the forwarded value.
Definition: basearray.h:627
TupleValue * GetTuple()
Definition: datatypebase.h:1548
Definition: datatypelib.h:871
Definition: datatype.h:1113
PyObject * tuple
Definition: abstract.h:150
Float64 Float
Definition: apibase.h:196
The data stored within a maxon::Data object can also be converted into another data type:
- maxon::Data::Convert(): Returns the data converted into the given data type.
- maxon::Data::ConvertOrNull(): Returns the data converted into the given data type or the maxon::NullValue of the desired data type.
Result< T > Convert() const
Definition: datatypebase.h:1440
Copy
The data stored in a maxon::Data object can easily be copied to another maxon::Data object.
Result< void > CopyFrom(const Data &src)
Result< Data > GetCopy() const
Returns a copy of the data.
Definition: datatype.h:1234
Compare
There are multiple ways to compare two given maxon::Data objects:
if (dataA.IsEqual(dataB))
if (dataA == dataB)
Py_UCS4 * res
Definition: unicodeobject.h:1113
COMPARERESULT
Data type for comparison results.
Definition: compare.h:21
Utility
Further utility functions are:
String ToString(const FormatStatement *formatStatement=nullptr) const
Definition: string.h:1287
void * str
Definition: bytesobject.h:77
Further Reading