About
maxon::Data is a generic container that can store any MAXON API ALIASES 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)
{
}
A given maxon::Data object can be inspected and reset with:
Data
The key function of maxon::Data is to store and access data stored in the object:
if (!integerType)
if (type == integerType)
{
number++;
}
The data stored within a maxon::Data object can also be converted into another data type:
Copy
The data stored in a maxon::Data object can easily be copied to another maxon::Data object.
Compare
There are multiple ways to compare two given maxon::Data objects:
if (dataA.IsEqual(dataB))
if (dataA == dataB)
Utility
Further utility functions are:
Further Reading
Result< void > CopyFrom(const Data &src)
Definition: datatypebase.h:1293
Result< T > Convert() const
Definition: datatypebase.h:1398
Definition: datatypebase.h:735
Bool IsPopulated() const
Definition: datatypebase.h:1215
Result< void > Init(const DataType &type)
Definition: datatypebase.h:1165
Definition: string.h:1213
Definition: datatypebase.h:1147
const T & Get(Int index, const TupleDataType &type) const
Definition: datatype.h:1014
#define iferr_return
Definition: resultbase.h:1465
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
Definition: datatypebase.h:1356
Float64 Float
Definition: apibase.h:195
Result< void > Set(T &&data)
Definition: datatypebase.h:1345
Result< Data > GetCopy() const
Returns a copy of the data.
Definition: datatype.h:1126
Definition: basearray.h:366
Definition: datatype.h:1004
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:167
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append()
Definition: basearray.h:569
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:174
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:186
Definition: datatypelib.h:667
COMPARERESULT Compare(const Data &c) const
Definition: datatypebase.h:1547
const DataType & GetType() const
Definition: datatypebase.h:1224
TupleValue * GetTuple()
Definition: datatypebase.h:1521
String ToString(const FormatStatement *formatStatement=nullptr) const
void Reset()
Frees the wrapped data and resetd the Data object to its initial state.
Definition: datatypebase.h:1229
Bool IsEmpty() const
Definition: datatypebase.h:1206
COMPARERESULT
Data type for comparison results.
Definition: compare.h:20