home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * Copyright (c) 1989-1992 Micro Digital Associates, Inc.
- * All Rights Reserved.
- *
- * MODULE: COUNTER.HPP
- *
- * DESRIPTION:
- * This class is the counter class. It is used to count
- * the number of times something happens and take action if
- * desired.
- *
- *
- * AUTHOR: Rick Evans
- *
- *
- * UPDATE LOG
- *
- *************************************************************************/
- #ifndef __COUNTER_HPP
- #define __COUNTER_HPP 1
-
- #include <xtypes.h> /* smx type and structure definitions */
-
- //Class
- class Counter
- {
- private:
-
- ECB_PTR CounterCBP;
-
- public:
-
- //-------- Constructors --------
- Counter();
- Counter( const Counter& c );
- Counter( ECB_PTR p );
-
-
- //---------- Methods -----------
- //Increament the event counter.
- BOOLEAN Signal();
-
- //Allows a task to wait on a event to occur a set number of times
- BOOLEAN Count( word count, word timeOut=INF );
- BOOLEAN CountStop( word count, word timeOut=INF );
-
- // queue methods
- BOOLEAN ClearQ();
- int QSize();
-
- //--------- Destructor ---------
- ~Counter();
- };
- #endif
- //EOF
-