summaryrefslogtreecommitdiff
path: root/Source/Library/Common/OrderedArray.class.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Common/OrderedArray.class.h')
-rw-r--r--Source/Library/Common/OrderedArray.class.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/Library/Common/OrderedArray.class.h b/Source/Library/Common/OrderedArray.class.h
new file mode 100644
index 0000000..3091249
--- /dev/null
+++ b/Source/Library/Common/OrderedArray.class.h
@@ -0,0 +1,29 @@
+#ifndef DEF_ORDARRAY_CLASS
+#define DEF_ORDARRAY_CLASS
+
+#include <common.h>
+
+template <typename T>
+class OrderedArray {
+ private:
+ T *m_array[];
+ u32int m_size;
+ u32int m_maxSize;
+
+ public:
+ OrderedArray(u32int max_size);
+ OrderedArray(T **addr, u32int max_size);
+ ~OrderedArray();
+
+ u32int size() { return m_size; }
+
+ void insert(T *element);
+ T *lookup(int index);
+ void remove(int index);
+
+ T *operator[] (int index) { return lookup(index); }
+};
+
+#include "OrderedArray.class.cpp"
+
+#endif