Veda/PackULong_RandomSeed.h

Go to the documentation of this file.
00001 /*! \file 
00002     \author victorien ferry & www.m4nkind.com
00003     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00004 */
00005 #ifndef COM_M4NKIND_PackULong_RandomSeed_H
00006 #define COM_M4NKIND_PackULong_RandomSeed_H
00007 
00008 #include "PackULong.h"
00009 
00010 /*!
00011     \class  PackULong_RandomSeed
00012     \ingroup    BaseSerializableClass
00013     \brief   PackULong_RandomSeed specializes PackULong to express a random number seed generator,
00014             and provide a random function, for procedural purposes.
00015             PackULong is a base type managing "28 bit unsigned long", which serializes a number
00016             between [0,512Mb-1], which can be written on 1, 2,3 or 4 bytes when needed.         
00017 */
00018 class PackULong_RandomSeed : public PackULong
00019 {
00020 /*==================================================================
00021                                 PUBLIC
00022 ==================================================================*/
00023 public:
00024 #ifdef _ENGINE_EDITABLE_
00025     /*!
00026         \brief  Constructor. 
00027     */
00028     PackULong_RandomSeed(void);
00029 #endif
00030 #ifdef _ENGINE_EDITABLE_
00031     /*!
00032         \brief  Destructor. 
00033     */
00034     virtual ~PackULong_RandomSeed(void);
00035 #endif
00036     /*!
00037         \brief  Reset the random list to its begining as defined by its seed number.
00038     */
00039     inline void Reset(){ m_CurrentRandomValue= m_value ;  };
00040 
00041     /*!
00042         \brief get a random number, continuing the suit of random number shaped by the seed.
00043     */
00044     unsigned int    GetRandomNumber();  
00045 /*==================================================================
00046                                 PROTECTED
00047 ==================================================================*/
00048 protected:
00049     unsigned int    m_CurrentRandomValue;
00050 };
00051 
00052 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/