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:1179
Result< void > Set(T &&data)
Definition: datatypebase.h:1373
Result< void > Init(const DataType &type)
Definition: datatypebase.h:1193
Definition: datatypebase.h:754
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
#define iferr_return
Definition: resultbase.h:1465
A given maxon::Data object can be inspected and reset with:
{
if (type)
}
void Reset()
Frees the wrapped data and resetd the Data object to its initial state.
Definition: datatypebase.h:1257
Bool IsEmpty() const
Definition: datatypebase.h:1234
Bool IsPopulated() const
Definition: datatypebase.h:1243
const DataType & GetType() const
Definition: datatypebase.h:1252
Data
The key function of maxon::Data is to store and access data stored in the object:
if (!integerType)
if (type == integerType)
{
number++;
}
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
Definition: datatypebase.h:1384
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:190
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:178
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
if (!tuple)
Definition: basearray.h:413
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append()
Definition: basearray.h:616
TupleValue * GetTuple()
Definition: datatypebase.h:1549
Definition: datatypelib.h:740
Definition: datatype.h:1067
const T & Get(Int index, const TupleDataType &type) const
Definition: datatype.h:1076
Float64 Float
Definition: apibase.h:199
The data stored within a maxon::Data object can also be converted into another data type:
Result< T > Convert() const
Definition: datatypebase.h:1426
Copy
The data stored in a maxon::Data object can easily be copied to another maxon::Data object.
Result< void > CopyFrom(const Data &src)
Definition: datatypebase.h:1321
Result< Data > GetCopy() const
Returns a copy of the data.
Definition: datatype.h:1193
Compare
There are multiple ways to compare two given maxon::Data objects:
if (dataA.IsEqual(dataB))
if (dataA == dataB)
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:1226
Further Reading