A number to wrap between 0~length. More...
#include <ame_Util.hpp>
Public Member Functions | |
Wrap (T length) | |
void | set (T n) |
Sets the current value to an arbitrary number. More... | |
T | get (T offset=0) const noexcept |
Get the current value or the number of the current value plus an offset. More... | |
void | changeLength (T newLength) noexcept |
The number to automatically wrap in the range [0, length-1]. More... | |
T | getLength () const noexcept |
T | operator++ () noexcept |
Prefix increment. More... | |
T | operator++ (int) noexcept |
Postfix increment. More... | |
T | operator+= (T add) noexcept |
+= operator. More... | |
A number to wrap between 0~length.
T | signed number (int32_t, float etc...) |
length | The number to automatically wrap in the range [0, length-1]. |
|
inlinenoexcept |
The number to automatically wrap in the range [0, length-1].
newLength |
|
inlinenoexcept |
Get the current value or the number of the current value plus an offset.
offset |
|
inlinenoexcept |
Prefix increment.
|
inlinenoexcept |
Postfix increment.
|
inlinenoexcept |
+= operator.
Add and return wrapped number.
add |
|
inline |
Sets the current value to an arbitrary number.
When n is not in the range of 0~length-1, the wrapped number is used as the current value.
n |