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

# XFuRandom.h

Go to the documentation of this file.

    00001 /*! \file
    00002  * X-Forge Util <br>
    00003  * Copyright 2000-2003 Fathammer Ltd
    00004  *
    00005  * \brief "Normal" random class
    00006  *
    00007  * $Id: XFuRandom.h,v 1.11 2003/08/12 13:33:52 lars Exp $
    00008  * $Date: 2003/08/12 13:33:52 $
    00009  * $Revision: 1.11 $
    00010  */
    00011
    00012 #ifndef XFURANDOM_H_INCLUDED
    00013 #define XFURANDOM_H_INCLUDED
    00014
    00015
    00016 //! Pseudo random number generator class.
    00017 class XFuRandom
    00018 {
    00019 public:
    00020
    00021     //! Static constructor.
    00022     /*! Random generator is initialized using system timer as the random seed value.
    00023      * \return new random number generator object if successful, or NULL if unsuccessful.
    00024      */
    00025     static XFuRandom * create();
    00026
    00027     //! Static constructor.
    00028     /*! \param aSeed seed value to be used for initializing the random number generator.
    00029      * \return new random number generator object if successful, or NULL if unsuccessful.
    00030      */
    00031     static XFuRandom * create(UINT32 aSeed);
    00032
    00033     //! Returns the next random number.
    00034     UINT32 next();
    00035     //! Re-seeds the random number generator.
    00036     void seed(UINT32 aSeed);
    00037     //! Destructor.
    00038     ~XFuRandom();
    00039
    00040 private:
    00041
    00042     //! Protected constructor.
    00043     XFuRandom();
    00044
    00045     UINT32 *mTable;
    00046     UINT32 mTableIndex;
    00047 };
    00048
    00049
    00050 #endif // !XFURANDOM_H_INCLUDED
    00051

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch