Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

XFuRandom Class Reference

Pseudo random number generator class. More...

#include <XFuRandom.h>

List of all members.

Public Member Functions

UINT32 next ()
 Returns the next random number.

void seed (UINT32 aSeed)
 Re-seeds the random number generator.

 ~XFuRandom ()
 Destructor.


Static Public Member Functions

XFuRandom * create ()
 Static constructor.

XFuRandom * create (UINT32 aSeed)
 Static constructor.


Private Member Functions

 XFuRandom ()
 Protected constructor.


Private Attributes

UINT32 * mTable
UINT32 mTableIndex


Detailed Description

Pseudo random number generator class.

Definition at line 17 of file XFuRandom.h.


Constructor & Destructor Documentation

XFuRandom::~XFuRandom  
 

Destructor.

Definition at line 36 of file XFuRandom.cpp.

References mTable.

XFuRandom::XFuRandom   [private]
 

Protected constructor.

Definition at line 43 of file XFuRandom.cpp.


Member Function Documentation

XFuRandom * XFuRandom::create UINT32    aSeed [static]
 

Static constructor.

Parameters:
aSeed seed value to be used for initializing the random number generator.
Returns:
new random number generator object if successful, or NULL if unsuccessful.

Definition at line 54 of file XFuRandom.cpp.

References mTable, seed(), and XFURMP_N.

XFuRandom * XFuRandom::create   [static]
 

Static constructor.

Random generator is initialized using system timer as the random seed value.

Returns:
new random number generator object if successful, or NULL if unsuccessful.

Definition at line 48 of file XFuRandom.cpp.

UINT32 XFuRandom::next  
 

Returns the next random number.

Definition at line 74 of file XFuRandom.cpp.

References mTable, mTableIndex, XFURMP_A, XFURMP_B, XFURMP_C, XFURMP_HIMASK, XFURMP_L, XFURMP_LOMASK, XFURMP_M, XFURMP_N, XFURMP_S, XFURMP_T, and XFURMP_U.

void XFuRandom::seed UINT32    aSeed
 

Re-seeds the random number generator.

Definition at line 107 of file XFuRandom.cpp.

References mTable, mTableIndex, and XFURMP_N.

Referenced by create().


Member Data Documentation

UINT32* XFuRandom::mTable [private]
 

Definition at line 45 of file XFuRandom.h.

Referenced by create(), next(), seed(), and ~XFuRandom().

UINT32 XFuRandom::mTableIndex [private]
 

Definition at line 46 of file XFuRandom.h.

Referenced by next(), and seed().


The documentation for this class was generated from the following files:
   
X-Forge Documentation
Confidential
Copyright © 2002-2003 Fathammer
   
Documentation generated
with doxygen
by Dimitri van Heesch