![]() |
NimbRo ROS Soccer Package
|
A simple counter class for counting events. More...
#include <wak_utils.h>
Public Member Functions | |
void | reset () |
int | count () const |
void | add (bool expr=true) |
void | increment () |
bool | reached (int limit) const |
A simple counter class for counting events.
Be very careful about using this counter because it does not saturate!! So if expr is true for a while, then the internal count winds up to a significantly high number, and it then takes an equally long period of expr being false for reached(NUM) to eventually return false again. This is normally not the desired behaviour in an application, so be careful to reset the counter at some point to alleviate this problem.