#ifndef __STATIC_STACK_H__
#define __STATIC_STACK_H__

#define DEFAULT_STACK_SIZE 256

namespace VRUT
{
	template <typename T, unsigned int SIZE = DEFAULT_STACK_SIZE>
	class StaticStack
	{

	private:

		size_t index;
		T content[SIZE];
		
	public:

		StaticStack(void) : index(0) {}

		inline bool Empty(void) const { return index == 0; }
		inline size_t Size(void) const { return index; }
		inline void Push(const T & item) { content[index++] = item; }
		inline void Pop(void) { --index; }
		inline const T & Top(void) const { return content[index-1]; }
		inline void Clear(void) { index = 0; }
		inline T & operator[](unsigned int index) { return content[index]; }

	};

}

#endif /* __STATIC_STACK_H__ */
