Proud::CRandom Class Reference

Public Member Functions

PROUD_API void InitializeSeed ()
 
void SetSeed (uint32_t dwSeed)
 
PROUD_API int GetInt ()
 
int64_t GetInt64 ()
 
double GetFloat ()
 

Static Public Member Functions

static PROUD_API int StaticGetInt ()
 
static int64_t StaticGetInt64 ()
 
static PROUD_API double StaticGetFloat ()
 

Detailed Description

Random value generator

Characteristics

  • If seeds are same then the randome values are same.

General usage

  • After creating CRandom object,use GetInt(), GetInt64, GetFloat and so on after calling InitializeSeed() or SetSeed() once for the first time.
  • If explicit random distribution is not required then just use StaticGet*().
  • If explicit random distribution is required then create this object, call InitializeSeed() once for the first time then use Get*().

Member Function Documentation

double Proud::CRandom::GetFloat ( )

Gets value from CRandom that created with global object. It is floating point value between 0 to 1. It does thread safe.

PROUD_API int Proud::CRandom::GetInt ( )

Creates random value. One value between INT_MIN~INT_MAX

int64_t Proud::CRandom::GetInt64 ( )

Creates random value. One value between INT64_MIN~INT64_MAX

PROUD_API void Proud::CRandom::InitializeSeed ( )

Set random number creating seed value

void Proud::CRandom::SetSeed ( uint32_t  dwSeed)

TODO:translate needed. Set random number creating seed value to specific value.

static PROUD_API double Proud::CRandom::StaticGetFloat ( )
static

Gets value from CRandom that created with global object. It is floating point value between 0 to 1. It does thread safe.

static PROUD_API int Proud::CRandom::StaticGetInt ( )
static

Gets value from CRandom that created with global object. It does thread safe.

static int64_t Proud::CRandom::StaticGetInt64 ( )
static

Gets value from CRandom that created with global object. It does thread safe.