home *** CD-ROM | disk | FTP | other *** search
/ C/C++ User's Journal & Wi…eveloper's Journal Tools / C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso / smxdemo / smxpp / counter.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-16  |  1.2 KB  |  57 lines

  1. /*************************************************************************
  2. *  Copyright (c) 1989-1992 Micro Digital Associates, Inc.
  3. *                  All Rights Reserved.
  4. *
  5. *  MODULE: COUNTER.HPP
  6. *
  7. *  DESRIPTION:
  8. *           This class is the counter class.  It is used to count
  9. *           the number of times something happens and take action if
  10. *           desired.
  11. *
  12. *
  13. *  AUTHOR: Rick Evans 
  14. *
  15. *
  16. *  UPDATE LOG
  17. *
  18. *************************************************************************/
  19. #ifndef  __COUNTER_HPP
  20. #define __COUNTER_HPP  1
  21.  
  22. #include    <xtypes.h>     /* smx type and structure definitions */
  23.  
  24. //Class
  25. class Counter
  26. {
  27. private:
  28.  
  29.    ECB_PTR     CounterCBP;
  30.  
  31. public:
  32.  
  33.    //-------- Constructors --------
  34.    Counter();
  35.    Counter( const Counter& c );
  36.    Counter( ECB_PTR p );
  37.  
  38.  
  39.    //---------- Methods -----------
  40.    //Increament the event counter.
  41.    BOOLEAN  Signal();
  42.  
  43.    //Allows a task to wait on a event to occur a set number of times
  44.    BOOLEAN  Count( word count, word timeOut=INF );
  45.    BOOLEAN  CountStop( word count, word timeOut=INF );
  46.  
  47.    // queue methods
  48.    BOOLEAN  ClearQ();
  49.    int      QSize();
  50.  
  51.    //--------- Destructor ---------
  52.    ~Counter();         
  53. };
  54. #endif
  55. //EOF
  56.  
  57.