DRandVar.h

00001 /*  _________________________________________________________________________
00002  *
00003  *  UTILIB: A utility library for developing portable C++ codes.
00004  *  Copyright (c) 2001, Sandia National Laboratories.
00005  *  This software is distributed under the GNU Lesser General Public License.
00006  *  For more information, see the README file in the top UTILIB directory.
00007  *  _________________________________________________________________________
00008  */
00009 
00010 //
00011 // DRandVar.h
00012 //
00019 #ifndef __DRandVar_h
00020 #define __DRandVar_h
00021 
00022 #ifndef ANSI_HDRS
00023 #include <math.h>
00024 #else
00025 #include <cmath>
00026 #endif
00027 #include "errmsg.h"
00028 #include "RNG.h"
00029 
00030 
00031 class UTILIB_API DRandVar {
00032 
00033 public:
00034 
00036     DRandVar(RNG *generator);
00037 
00039     virtual int operator()() = 0;
00040 
00042     RNG *generator();
00044     void generator(RNG *p);
00045 
00046 protected:
00047 
00049     RNG          *pGenerator;
00050 
00051 };
00052 
00053 
00054 inline DRandVar::DRandVar(RNG *gen)
00055 { pGenerator = gen; }
00056 
00057 inline RNG *DRandVar::generator()
00058 { return(pGenerator); }
00059  
00060 inline void DRandVar::generator(RNG *p)
00061 { pGenerator = p; }
00062 
00063 #endif