summaryrefslogtreecommitdiff
path: root/Source/Library/Common/OrderedArray.class.h
blob: 30912495efc54f2b4b2ba663f2ae4dc72ffb37fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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