home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume43 / gen / part02 / StringQueue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-24  |  767 b   |  45 lines

  1. /*
  2. File: StringQueue.h
  3.  
  4. Author: Bruce Kritt
  5.  
  6. Description:
  7. */
  8.  
  9. struct StringCell
  10. {
  11.         String* info;
  12.         StringCell* next;
  13. };
  14.  
  15. class StringQueue
  16. {
  17. private:
  18.         // attributes
  19.  
  20.         StringCell* back;
  21.         int length;
  22. public:
  23.         // constructors
  24.  
  25.         StringQueue(void):back(0),length(0){ }
  26.         StringQueue(StringQueue& copy);
  27.  
  28.         // destructor
  29.  
  30.         ~StringQueue();
  31.  
  32.         // public services
  33.  
  34.         int Length(void) const {return length;}
  35.         int Empty(void) const {return (Length() == 0);}
  36.  
  37.         String Front(void) const;
  38.         String Back(void) const;
  39.  
  40.         void Enqueue(String string);
  41.         String Dequeue(void);
  42.         void Rotate(void){if (Length() > 1) back = back->next;}
  43.  
  44. };      // end class StringQueue
  45.