home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / CLOBSS.PAK / DEQUE.CPO < prev    next >
Text File  |  1995-08-29  |  1KB  |  46 lines

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