|
| | RangeCounter (const T init=0, const T reset=std::numeric_limits< T >::max(), const T step=1) |
| | Constructor.
|
| |
| T | operator() () |
| | Increment the counter by the step value and return the previous value, modulo the reset value.
|
| |
| T | operator++ () |
| | Pre-increment the counter by the step value, modulo the reset value.
|
| |
| T | operator++ (int) |
| | Post-increment the counter by the step value, modulo the reset value.
|
| |
| T | operator+= (const int n) |
| | Increment the counter by n steps, modulo the reset value.
|
| |
| | Counter (const unsigned long init=0, const unsigned long step=1) |
| | Constructor.
|
| |
| unsigned long | operator() () |
| | Increment the counter by the step value and return the previous value.
|
| |
| unsigned long | operator++ () |
| | Pre-increment the counter by the step value.
|
| |
| unsigned long | operator++ (int) |
| | Post-increment the counter by the step value.
|
| |
| unsigned long | operator+= (const int n) |
| | Increment the counter by n steps.
|
| |
| unsigned long | operator-- () |
| | Pre-decrement the counter by the step value.
|
| |
| unsigned long | operator-- (int) |
| | Post-decrement the counter by the step value.
|
| |
| unsigned long | operator-= (const int n) |
| | Decrement the counter by n steps.
|
| |
| void | set (const unsigned long value) |
| | Set the counter to a specific value.
|
| |
|
void | reset () |
| | Reset the counter to its initial value.
|
| |
template<typename T = unsigned long>
class rush::RangeCounter< T >
A counter class that resets after reaching a specified limit.
- Template Parameters
-
| T | The type of the counter, default is unsigned long. |