NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
walk_and_kick::Counter Class Reference

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
 

Detailed Description

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.


The documentation for this class was generated from the following file: