summaryrefslogblamecommitdiff
path: root/Source/Library/Common/OrderedArray.class.h
blob: 30912495efc54f2b4b2ba663f2ae4dc72ffb37fe (plain) (tree)
1
2
3
4


                          
                   
























                                                           
#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