classPii::CountFunction
#include <PiiFunctional.h>
A unary function that increments/decrements its internal counter by a predefined value each time the function is called.
Inherits Pii::Generator< T >
Description
PiiMatrix<float> matrix(1,3); // Fill matrix Pii::fill(matrix.begin(), matrix.end(), Pii::CountFunction<float>(0,2)); // matrix = 0 2 4
Constructors and destructor
|
(
Create a new count function with the given initial value and increment. |
Public member functions
|
int
|
( )
Get the current value of the internal counter. |
|
int
|
( )
Get value of the increment. |
|
T
|
( )
Increase the internal counter by the increment. |
|
void
|
(
Set the value of the internal counter. |
|
void
|
(
Set the value of the increment. |
Function details
-
CountFunction
(- int initialValue = 0
- int increment = 1
[inline]Create a new count function with the given initial value and increment.
-
int count
()[inline]Get the current value of the internal counter.
-
int increment
()[inline]Get value of the increment.
-
T operator()
()[inline]Increase the internal counter by the increment.
-
void setCount
(- int count
[inline]Set the value of the internal counter.
-
void setIncrement
(- int increment
[inline]Set the value of the increment.
Add a note
Not a single note added yet. Be the first, add yours.