PrevNextUpHome BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1
SFXBrewRandom
Class that generates a random number using the random number generation function of BREW API.
#include <SFXBrewRandom.h.hpp>
class SFXBrewRandom;
SFMTYPEDEFCLASS(SFXBrewRandom)

Example

// number between UINT32_MINIMUM and UINT32_MAXIMUM
SInt32 n1 = SFXBrewRandom::GetSInt32();   // get a random number

// number between 0 and UINT08_MAXIMUM
UInt08 n2 = SFXBrewRandom::GetUInt08();   // get a random number

// number can be conceivable as Float64
Float64 n3 = SFXBrewRandom::GetFloat64(); // get a random number

// Bool b = static_cast<Bool>(SFXBrewRandom::GetUInt32() % 2);
// write the code below instead of the above code to get a better random number of Bool type
Bool b = SFXBrewRandom::GetBool();        // get a random number of Bool type

Member

Public Functions
static
Bool
GetBool( Void )
Generate a random number of Bool type.
static
Float32
GetFloat32( Void )
Generate a random number of Float32 type.
static
Float64
GetFloat64( Void )
Generate a random number of Float64 type.
static
SInt08
GetSInt08( Void )
Generate a random number of SInt08 type.
static
SInt16
GetSInt16( Void )
Generate a random number of SInt16 type.
static
SInt32
GetSInt32( Void )
Generate a random number of SInt32 type.
static
UInt08
GetUInt08( Void )
Generate a random number of UInt08 type.
static
UInt16
GetUInt16( Void )
Generate a random number of UInt16 type.
static
UInt32
GetUInt32( Void )
Generate a random number of UInt32 type.

SFXBrewRandom::GetBool
Generate a random number of Bool type.
[ public, static ]
Bool GetBool(Void);

Description

Return the Bool-casted value of the 25th-from-lowest bit of a random number of UInt32 type.

Example

SFXBrewRandom::GetBool();

SFXBrewRandom::GetFloat32
Generate a random number of Float32 type.
[ public, static ]
Float32 GetFloat32(Void);

Return value

The return value takes the value from 0 to less than 1.

Description

Return the Float32-casted value of a random number of UInt32 type divided by 4294967296.

Example

SFXBrewRandom::GetFloat32();

SFXBrewRandom::GetFloat64
Generate a random number of Float64 type.
[ public, static ]
Float64 GetFloat64(Void);

Return value

The return value takes the value from 0 to less than 1.

Description

Return the Float64-casted value of a random number of UInt32 type divided by 4294967296.

Example

SFXBrewRandom::GetFloat64();

SFXBrewRandom::GetSInt08
Generate a random number of SInt08 type.
[ public, static ]
SInt08 GetSInt08(Void);

Description

Return the SInt08-casted value of the highest 8 bits of a random number of UInt32 type.

Example

SFXBrewRandom::GetSInt08();

SFXBrewRandom::GetSInt16
Generate a random number of SInt16 type.
[ public, static ]
SInt16 GetSInt16(Void);

Description

Return the SInt16-casted value of the highest 16 bits of a random number of UInt32 type.

Example

SFXBrewRandom::GetSInt16();

SFXBrewRandom::GetSInt32
Generate a random number of SInt32 type.
[ public, static ]
SInt32 GetSInt32(Void);

Description

Return the SInt32-casted value of a random number of UInt32 type.

Example

SFXBrewRandom::GetSInt32();

SFXBrewRandom::GetUInt08
Generate a random number of UInt08 type.
[ public, static ]
UInt08 GetUInt08(Void);

Description

Return the UInt08-casted value of the highest 8 bits of a random number of UInt32 type.

Example

SFXBrewRandom::GetUInt08();

SFXBrewRandom::GetUInt16
Generate a random number of UInt16 type.
[ public, static ]
UInt16 GetUInt16(Void);

Description

Return the UInt16-casted value of the highest 16 bits of a random number of UInt32 type.

Example

SFXBrewRandom::GetUInt16();

SFXBrewRandom::GetUInt32
Generate a random number of UInt32 type.
[ public, static ]
UInt32 GetUInt32(Void);

Description

Return a random number of UInt32 type.

Example

SFXBrewRandom::GetUInt32();