Automatic integer counting class.
More...
#include <counter.h>
Automatic integer counting class.
This is an automatic counting object that is used to retrieve a new integer value between 0 and n each time the object is referenced. When reaching the last n value, the object restarts at 0, and so is used to retrieve a sequence of values in order.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 43 of file counter.h.
◆ counter()
ucommon::counter::counter |
( |
unsigned |
limit | ) |
|
Initialize integer counter for a range of values.
- Parameters
-
limit | before recycling to zero. |
◆ get()
unsigned ucommon::counter::get |
( |
void |
| ) |
|
Get the next counter value.
- Returns
- next counter value.
◆ operator *()
unsigned ucommon::counter::operator * |
( |
| ) |
|
|
inline |
Reference next counter value through pointer operation.
- Returns
- next counter value.
Definition at line 78 of file counter.h.
◆ operator unsigned()
ucommon::counter::operator unsigned |
( |
| ) |
|
|
inline |
Reference next counter value by casting to integer.
- Returns
- next counter value.
Definition at line 86 of file counter.h.
◆ operator=()
void ucommon::counter::operator= |
( |
unsigned |
value | ) |
|
Assign the value of the counter.
- Parameters
-
◆ range()
unsigned ucommon::counter::range |
( |
void |
| ) |
|
|
inline |
Get the range of values before recycling.
- Returns
- counter limit.
Definition at line 70 of file counter.h.
The documentation for this class was generated from the following file: