class RED::RNG
Abstract class providing an interface to random number generators. More...
#include <REDRandom.h>
Inherits: Object.
Inherited by: FastRandom and Random.
Public functions:
virtual void * | As ( const RED::CID & iCID ) |
virtual const void * | As ( const RED::CID & iCID ) const |
template< class T_As > const T_As * | As ( ) const |
template< class T_As > T_As * | As ( ) |
virtual void | Init ( unsigned int iSeed ) = 0 |
virtual unsigned int | Rand32 ( ) = 0 |
double | RandD ( ) |
Public static functions:
static RED::CID | GetClassID ( ) |
Public static variables:
static const unsigned int | Max32 |
Detailed description:
Abstract class providing an interface to random number generators.
REDsdk makes an extensive use of random numbers. As a consequence REDsdk provides several random number generators for dedicated usages. Each generator inherits this class.
Functions documentation
public static RED::CID RED::RNG::GetClassID | ( | ) |
Reimplements: RED::Object::GetClassID.
Reimplemented by: RED::FastRandom::GetClassID and RED::Random::GetClassID.
public virtual void * RED::RNG::As | ( | const RED::CID & | iCID | ) |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
Reimplemented by: RED::FastRandom::As and RED::Random::As.
public virtual const void * RED::RNG::As | ( | const RED::CID & | iCID | ) const |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
Reimplemented by: RED::FastRandom::As and RED::Random::As.
template< class T_As > public const T_As * RED::RNG::As | ( | ) const |
Template version of the as const method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
Reimplemented by: RED::FastRandom::As and RED::Random::As.
template< class T_As > public T_As * RED::RNG::As | ( | ) |
Template version of the as method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
Reimplemented by: RED::FastRandom::As and RED::Random::As.
public virtual void RED::RNG::Init | ( | unsigned int | iSeed | ) = 0 |
Initializes a 32bit pseudo-random numbers generator.
Parameters:
iSeed: | seed used for initialization. |
Implemented by: RED::FastRandom::Init and RED::Random::Init.
public virtual unsigned int RED::RNG::Rand32 | ( | ) = 0 |
Returns:
Implemented by: RED::FastRandom::Rand32 and RED::Random::Rand32.
public double RED::RNG::RandD | ( | ) |
Returns:
Variables documentation
Maximum value returned by Rand32 + 1.