#include <Counter.h>
Inheritance diagram for GNE::Counter:
Public Types | |
typedef SmartPtr< Counter > | sptr |
typedef WeakPtr< Counter > | wptr |
Public Member Functions | |
virtual | ~Counter () |
Destructor. | |
void | timerCallback () |
The callback function that the Timer calls. | |
int | getCount () |
Returns the current count of this Counter. | |
void | setCount (int newCount) |
Sets the current count to newCount. | |
void | adjustCount (int val) |
Adjusts the counter's value by adding val to the current count. | |
void | waitAndDecrement () |
This method blocks until the count is greater than zero. | |
Static Public Member Functions | |
sptr | create () |
Create a Counter. |
|
Adjusts the counter's value by adding val to the current count. This means that negative numbers will subtract from the current count. |
|
Create a Counter. Pass this Counter into a Timer class to use it.
|
|
Sets the current count to newCount.
|
|
The callback function that the Timer calls. You should not call this function directly. Implements GNE::TimerCallback. |
|
This method blocks until the count is greater than zero. If the count is already greater than zero it returns immediately. In either case, the value of the counter is decremented. |