home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / prog / cm / cmtdeque.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-06  |  1.4 KB  |  35 lines

  1. // CmTDeque.h
  2. // -----------------------------------------------------------------
  3. // Compendium - C++ Container Class Library
  4. // Copyright (C) 1992-1994, Glenn M. Poorman, All rights reserved
  5. // -----------------------------------------------------------------
  6. // Deque (double ended queue) template definition.
  7. // -----------------------------------------------------------------
  8.  
  9. #ifndef _CMTDEQUE_H
  10. #define _CMTDEQUE_H
  11.  
  12. #include <cm/include/cmtlist.h>
  13.  
  14. template <class T> class CmTDeque : public CmTLinkedList<T> {
  15. public:
  16.   CmTDeque() {}                                 // Default deque constructor.
  17.   CmTDeque(const CmTDeque<T>&);                 // Deque copy constructor.
  18.  ~CmTDeque() {}                                 // Deque destructor.
  19.  
  20.   CmTDeque<T>& operator=(const CmTDeque<T>&);   // Assignment operator.
  21.  
  22.   Bool     pushLeft (const T&);                 // Push item into queue left.
  23.   Bool     pushRight(const T&);                 // Push item into queue right.
  24.   T        popLeft  ();                         // Pop item from queue left.
  25.   T        popRight ();                         // Pop item from queue right.
  26.   const T& peekLeft () const;                   // Return copy of left item.
  27.   const T& peekRight() const;                   // Return copy of right item.
  28. };
  29.  
  30. #if defined(__TURBOC__) || defined(__xlC__)
  31. #include <cm/include/cmtdeque.cc>
  32. #endif
  33.  
  34. #endif
  35.