iLand
Public Member Functions | List of all members
RandomIndex Class Reference

index of a given size in a random order. More...

#include <random.h>

Public Member Functions

 RandomIndex (int aCount)
 creates a index with aCount entries. More...
 
 ~RandomIndex ()
 
bool next ()
 retrieve next index. return false if all indices used. More...
 
int index () const
 retrieve (random) index More...
 

Detailed Description

index of a given size in a random order.

Example-Usage:

RandomIndex r(100); // create
while (r.next())
qDebug() << r.index(); // prints out 100 numbers (0..99) in a random order.
index of a given size in a random order.
Definition: random.h:27

Constructor & Destructor Documentation

◆ RandomIndex()

RandomIndex::RandomIndex ( int  aCount)

creates a index with aCount entries.

◆ ~RandomIndex()

RandomIndex::~RandomIndex ( )

Member Function Documentation

◆ index()

int RandomIndex::index ( ) const
inline

retrieve (random) index

◆ next()

bool RandomIndex::next ( )

retrieve next index. return false if all indices used.


The documentation for this class was generated from the following files: