Isle
Loading...
Searching...
No Matches
mxcollection.h
Go to the documentation of this file.
1#ifndef MXCOLLECTION_H
2#define MXCOLLECTION_H
3
4#include "mxcore.h"
5
9template <class T>
10class MxCollection : public MxCore {
11public:
14 {
15 m_count = 0;
17 }
18
23 virtual MxS8 Compare(T a, T b) { return 0; } // vtable+0x14
24
26 ~MxCollection() override {}
27
30 static void Destroy(T obj) {}
31
34 void SetDestroy(void (*p_customDestructor)(T)) { this->m_customDestructor = p_customDestructor; }
35
36protected:
38 void (*m_customDestructor)(T);
39};
40
41#endif // MXCOLLECTION_H
[AI] Template class for a generic collection, providing fundamental storage and comparison facilities...
Definition: mxcollection.h:10
MxU32 m_count
[AI] Number of elements currently stored in the collection.
Definition: mxcollection.h:37
~MxCollection() override
[AI] Virtual destructor for proper polymorphic destruction.
Definition: mxcollection.h:26
MxCollection()
[AI] Constructs an empty collection, initializing count and default element destructor.
Definition: mxcollection.h:13
virtual MxS8 Compare(T a, T b)
[AI] Compares two elements of the collection (default implementation returns zero; override in subcla...
Definition: mxcollection.h:23
static void Destroy(T obj)
[AI] Static no-op destroy function; suitable for types that do not need destruction.
Definition: mxcollection.h:30
void SetDestroy(void(*p_customDestructor)(T))
[AI] Assigns a custom destructor function to be used for elements of this collection.
Definition: mxcollection.h:34
void(* m_customDestructor)(T)
[AI] Function pointer to the custom element destructor used for cleanup of elements.
Definition: mxcollection.h:38
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14