#ifndef _FASTSTACK_H_ #define _FASTSTACK_H_ // Classes template class CFastStack { public : inline CFastStack(); inline void Push(TYPE* pTYPE); inline TYPE* Pop(); inline void Clear() { m_iTYPE = 0; } inline bool IsEmpty() { return m_iTYPE == 0; } inline int GetSize() { return m_iTYPE; } protected : int m_iTYPE; // The next free TYPE TYPE* m_aTYPEs[SIZE]; // The array of types }; // Methods template inline CFastStack::CFastStack() { m_iTYPE = 0; } template inline void CFastStack::Push(TYPE* pTYPE) { m_aTYPEs[m_iTYPE++] = pTYPE; } template inline TYPE* CFastStack::Pop() { return m_aTYPEs[--m_iTYPE]; } #endif