| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- File List
- File Members

# RndmGen.h

Go to the documentation of this file.

    00001 //====================================================================
    00002 //      Random RndmGen class definition
    00003 //--------------------------------------------------------------------
    00004 //
    00005 //      Package    : Gaudi/RndmGen ( The LHCb Offline System)
    00006 //      Author     : M.Frank
    00007 //====================================================================
    00008 #ifndef GAUDI_RANDOMGENSVC_RNDMGEN_H
    00009 #define GAUDI_RANDOMGENSVC_RNDMGEN_H 1
    00010
    00011 // Framework include files
    00012 #include "GaudiKernel/IRndmGen.h"
    00013
    00014 // Forward declarations
    00015 class IRndmEngine;
    00016
    00039 class RndmGen : virtual public IRndmGen   {
    00040
    00041 private:
    00043   unsigned long     m_refCount;
    00044
    00045 protected:
    00047   IRndmGen::Param*  m_params;
    00049   IRndmEngine*      m_engine;
    00050
    00052   RndmGen(IInterface* engine);
    00054   virtual ~RndmGen();
    00055
    00056 public:
    00058
    00059   unsigned long addRef()    {
    00060     return ++m_refCount;
    00061   }
    00062
    00064   unsigned long release()   {
    00065     unsigned long cnt = --m_refCount;
    00066     if ( cnt <= 0 )   {
    00067       delete this;
    00068     }
    00069     return cnt;
    00070   }
    00072   StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
    00073
    00075
    00076   virtual StatusCode initialize(const IRndmGen::Param& par);
    00078   virtual StatusCode finalize();
    00080   virtual const InterfaceID& type() const    {
    00081     return (m_params != 0) ? m_params->type() : IID_IRndmFlat;
    00082   }
    00084   virtual const long ID() const    {
    00085     return long(this);
    00086   }
    00088   virtual const IRndmGen::Param* parameters() const    {
    00089     return m_params;
    00090   }
    00092   virtual double shoot() const;
    00098   virtual StatusCode shootArray( std::vector<double>& array, long howmany, long start) const;
    00099 };
    00100
    00101 #endif // GAUDI_RANDOMGENSVC_RNDMGEN_H