This class iterates over all the integer values from 0 to length-1 in random order.
|
| GRandomIndexIterator (size_t length, GRand &rand) |
| General-purpose constructor. This constructor does not call reset(). You should probably call reset() before you call next() for the first time. More...
|
|
| ~GRandomIndexIterator () |
|
size_t | length () |
| Returns the length of the list of indexes. More...
|
|
bool | next (size_t &outIndex) |
| If the end of the list has been reached, returns false. Otherwise, sets outIndex to the next index, and returns true. (Note that you should call reset() before the first call to this method. The constructor does not call reset() for you.) More...
|
|
size_t | pos () |
| Returns the current position in the list of indexes. (This might be used, for example, to identify progress.) Note that you need to subtract 1 to obtain the position of the value from the most recent call to "next". More...
|
|
GRand & | rand () |
| Returns a reference to the random number generator. More...
|
|
void | reset () |
| Shuffles the order of the indexes, and starts the iterator over at the beginning. More...
|
|