summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library/OrderedArray.class.h
blob: 2a5acdda24357ba26a21cf87802ec684bf4e457d (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 <Core/common.wtf.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