home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 2.ddi / CLASSINC.ZIP / QUEUE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.7 KB  |  103 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  QUEUE.H                                                               */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991, 1992                            */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __QUEUE_H )
  11. #define __QUEUE_H
  12.  
  13. #if defined( TEMPLATES )
  14.  
  15.     #if !defined( __QUEUES_H )
  16.     #include <Queues.h>
  17.     #endif  // __QUEUES_H
  18.  
  19.     #pragma option -Vo-
  20.     #if defined( __BCOPT__ ) && !defined( _ALLOW_po )
  21.     #pragma option -po-
  22.     #endif
  23.  
  24.     #define Queue   BI_TCQueueAsDoubleList
  25.     #define PQueue  PBI_TCQueueAsDoubleList
  26.     #define RQueue  RBI_TCQueueAsDoubleList
  27.     #define RPQueue RPBI_TCQueueAsDoubleList
  28.     #define PCQueue PCBI_TCQueueAsDoubleList
  29.     #define RCQueue RCBI_TCQueueAsDoubleList
  30.  
  31.     _CLASSDEF( BI_TCQueueAsDoubleList )
  32.  
  33.     #define QueueIterator   BI_TCQueueAsDoubleListIterator
  34.     #define PQueueIterator  PBI_TCQueueAsDoubleListIterator
  35.     #define RQueueIterator  RBI_TCQueueAsDoubleListIterator
  36.     #define RPQueueIterator RPBI_TCQueueAsDoubleListIterator
  37.     #define PCQueueIterator PCBI_TCQueueAsDoubleListIterator
  38.     #define RCQueueIterator RCBI_TCQueueAsDoubleListIterator
  39.  
  40.     _CLASSDEF( BI_TCQueueAsDoubleListIterator )
  41.  
  42. #else   // TEMPLATES
  43.  
  44.     #if !defined( __CLSTYPES_H )
  45.     #include <ClsTypes.h>
  46.     #endif  // __CLSTYPES_H
  47.  
  48.     #if !defined( __DEQUE_H )
  49.     #include <Deque.h>
  50.     #endif  // __DEQUE_H
  51.  
  52.     #pragma option -Vo-
  53.     #if defined( __BCOPT__ ) && !defined( _ALLOW_po )
  54.     #pragma option -po-
  55.     #endif
  56.  
  57.     _CLASSDEF(Queue)
  58.  
  59.     class _CLASSTYPE Queue : public Deque
  60.     {
  61.  
  62.     public:
  63.  
  64.         Object _FAR & get()
  65.             {
  66.             return Deque::getRight();
  67.             }
  68.  
  69.         void put( Object _FAR & o )
  70.             {
  71.             Deque::putLeft( o );
  72.             }
  73.  
  74.         virtual classType isA() const
  75.             {
  76.             return queueClass;
  77.             }
  78.  
  79.         virtual char _FAR *nameOf() const
  80.             {
  81.             return "Queue";
  82.             }
  83.  
  84.     private:
  85.  
  86.         Object _FAR & getLeft();
  87.         Object _FAR & getRight();
  88.  
  89.         void putLeft( Object _FAR & );
  90.         void putRight( Object _FAR & );
  91.  
  92.     };
  93.  
  94. #endif  // TEMPLATES
  95.  
  96. #if defined( __BCOPT__ ) && !defined( _ALLOW_po )
  97. #pragma option -po.
  98. #endif
  99. #pragma option -Vo.
  100.  
  101. #endif  // __QUEUE_H
  102.  
  103.