home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-1.ZIP / CLASSSRC.ZIP / DEQUE.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  1KB  |  46 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  DEQUE.CPP                                                             */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __DEQUE_H )
  11. #include <Deque.h>
  12. #endif    // __DEQUE_H
  13.  
  14. #ifndef __IOSTREAM_H
  15. #include <iostream.h>
  16. #endif
  17.  
  18. Object& Deque::getLeft()
  19. {
  20.     Object& temp = theDeque.peekAtHead();
  21.     if( temp != NOOBJECT )
  22.         {
  23.         theDeque.detachFromHead( temp );
  24.         itemsInContainer--;
  25.         }
  26.     return temp;
  27. }
  28.  
  29. Object& Deque::getRight()
  30. {
  31.     Object& temp = theDeque.peekAtTail();
  32.     if( temp != NOOBJECT )
  33.         {
  34.         theDeque.detachFromTail( temp );
  35.         itemsInContainer--;
  36.         }
  37.     return temp;
  38. }
  39.  
  40. ContainerIterator& Deque::initIterator() const
  41. {
  42.     return *((ContainerIterator *)new DoubleListIterator(this->theDeque));
  43. }
  44.  
  45.  
  46.