home *** CD-ROM | disk | FTP | other *** search
/ Informática Multimedia: Special Games / INFESPGAMES.mdf / os2 / ribble / support / cstack.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-09  |  634 b   |  31 lines

  1. //  $Source: C:\logical\store\classes/RCS/CSTACK.H,v $
  2. //  $Revision: 1.2 $
  3. //  $Date: 1993/10/20 21:42:13 $
  4. //  $Author: jason $
  5.  
  6. #include <CSupport.h>
  7. #include <CSList.h>
  8.  
  9. #ifndef _CStack_h
  10. #define _CStack_h
  11.  
  12.  
  13. template <class T>
  14. class CSExport CStack
  15. {
  16. public:
  17.   CStack()            {  }
  18.   ~CStack()           {  }
  19.   CStack(const CStack<T>& _stk) : stack(_stk.stack) { }
  20.   int isEmpty()       { return !stack; }
  21.   operator int()      { return !isEmpty(); }
  22.   T pop(void)         { return stack.remHead(); }
  23.   void push(const T& item)  { stack.addHead(item); }
  24.  
  25. private:
  26.   CSList<T> stack;
  27. };
  28.  
  29. #endif
  30.  
  31.