About
The MAXON API provides various array templates. These array types should be used instead of simple C-arrays to store data.
PointerArray
A maxon::PointerArray is optimized to store C++ pointers and owns the pointed objects.
- Note
- In general it is recommended to manage the lifetime of an object using references, see References.
{
storage.Disconnect();
}
Py_ssize_t i
Definition: abstract.h:645
Py_ssize_t count
Definition: abstract.h:640
Definition: pointerarray.h:43
void Reset()
Deletes all elements (calls destructors and frees memory).
Definition: pointerarray.h:91
MAXON_ATTRIBUTE_FORCE_INLINE Int GetCount() const
Definition: pointerarray.h:122
ResultPtr< T > AppendPtr(T *x)
Definition: pointerarray.h:296
PyObject * obj
Definition: complexobject.h:60
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:188
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
#define NewObj(T,...)
Definition: newobj.h:108
#define iferr_return
Definition: resultbase.h:1465
SortedArray
A sorted array automatically sorts the stored elements on first read access.
class ExampleClassSortedArray :
public maxon::SortedArray<ExampleClassSortedArray, maxon::BaseArray<ExampleClass>>
{
public:
{
return a.GetValue() < b.GetValue();
}
{
return a.GetValue() == b.GetValue();
}
};
ExampleClassSortedArray sortedArray;
ExampleClass* const object = sortedArray.GetFirst();
if (object)
{
}
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value &&!STD_IS_REPLACEMENT(same, typename std::decay< COMPARE >::type, EQUALITY), Bool >::type IsEqual(const COLLECTION2 &other, COMPARE &&cmp=COMPARE()) const
Definition: collection.h:236
Definition: sortedarray.h:51
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:181
Bool LessThan(UInt a1, UInt a2, UInt b1, UInt b2)
Definition: integer.h:151
Utility
These generic array types are used to define functions that can be used with various array types:
{
{
}
}
Py_ssize_t size
Definition: bytesobject.h:86
PyObject * element
Definition: unicodeobject.h:1016
Further Reading