home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CPPCOM17.ZIP / CHARQUEU.HPP < prev    next >
C/C++ Source or Header  |  1991-02-27  |  1KB  |  40 lines

  1. /***************************************************************************
  2. These C++ classes are copyright 1990, by William Herrera.
  3. All those who put this code or its derivatives in a commercial product MUST
  4. mention this copyright in their documentation for users of the products in
  5. which this code or its derivative classes are used.  Otherwise, this code
  6. may be freely distributed and freely used for any purpose.
  7. ***************************************************************************/
  8.  
  9. // file charqueu.hpp class declaration for the CharQueue class.
  10.  
  11. #ifndef CHARQUEU_HPP
  12. #define CHARQUEU_HPP 1
  13.  
  14. #include <bool.h>    // enum boolean { false, true }; if you don't have
  15.  
  16. class CharQueue 
  17. {
  18. protected:
  19.     char * queue_buffer;
  20.     unsigned int size;
  21.     unsigned int count;
  22.     unsigned int add_position;
  23.     unsigned int get_position;
  24. public:
  25.     CharQueue(unsigned int bufsize = 1000);
  26.     ~CharQueue();
  27.     int Add(char ch);
  28.     int Get();
  29.     int Peek();
  30.     void Purge();
  31.     unsigned int GetCount();
  32.     boolean IsFull();
  33.     boolean IsEmpty();
  34. };
  35.  
  36. #endif
  37.  
  38. // end of file CharQueu.hpp
  39.  
  40.