home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD 24 / PCPLUS115.iso / pcplus / tclite / include / queue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-28  |  632 b   |  31 lines

  1. #ifndef QUEUE_H
  2. #define QUEUE_H
  3.  
  4. #include "object.h"
  5.  
  6. class Object;
  7. class ArrayOb;
  8.  
  9. const unsigned QUEUE_DEFAULT_CAPACITY    = 16;
  10. const unsigned QUEUE_EXPANSION_INCREMENT = 32;
  11.  
  12. class Queue : public Object
  13. {
  14.     ArrayOb *pContents;
  15.     int readPosition;
  16.     int writePosition;
  17.     void makeRoomForWrite();
  18. public:
  19.     Queue(int sz=QUEUE_DEFAULT_CAPACITY);
  20.     Object* next();
  21.     Object* nextPut(const Object& ob);
  22.     unsigned capacity() const;
  23.     unsigned size() const;
  24.     void printOn(ostream& strm) const;
  25.     void state() const;  //diagnostic
  26.     virtual const Class* isA() const;
  27. };
  28.  
  29. #endif
  30.  
  31.