stack.h
上传用户:tt_chan
上传日期:2009-12-03
资源大小:4523k
文件大小:1k
- /*
- Stack
- Date:
- 2001/02/05
- */
- #ifndef __ORZ_DATASTRUCTURE_STACK__
- #define __ORZ_DATASTRUCTURE_STACK__
- #include "list.h"
- template< class T >
- class CStack : public CList< T >
- {
- public:
- virtual bool Push( T *pData );
- virtual bool PushHead( T *pData );
- virtual T * Pop();
- };
- template< class T >
- bool CStack< T >::Push( T * pData )
- {
- return CList< T >::Insert( pData );
- }
- template< class T >
- bool CStack< T >::PushHead( T * pData )
- {
- return CList< T >::InsertHead( pData );
- }
- template< class T >
- T * CStack< T >::Pop()
- {
- if ( IsEmpty() )
- return NULL;
- return RemoveNode( m_pTail );
- }
- #endif