Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

RndmGenSvc.h

Go to the documentation of this file.
00001 //====================================================================
00002 //      Random Generator service definition
00003 //--------------------------------------------------------------------
00004 //
00005 //      Package    : Gaudi/RndmGen ( The LHCb Offline System)
00006 //      Author     : M.Frank
00007 //====================================================================
00008 #ifndef GAUDI_RANDOMGENSVC_RNDMGENSVC_H
00009 #define GAUDI_RANDOMGENSVC_RNDMGENSVC_H 1
00010 
00011 // STL include files
00012 #include <vector>
00013 
00014 // Framework include files
00015 #include "GaudiKernel/Service.h"
00016 #include "GaudiKernel/ISerialize.h"
00017 #include "GaudiKernel/IRndmGen.h"
00018 #include "GaudiKernel/IRndmEngine.h"
00019 #include "GaudiKernel/IRndmGenSvc.h"
00020 
00021 // Forward declarations
00022 template <class TYPE> class SvcFactory;
00023 class IRndmGenFactory;
00024 class IMessageSvc;
00025 class IFactory;
00026 
00027 
00052 class RndmGenSvc : public Service, virtual public IRndmGenSvc, virtual public IRndmEngine, virtual public ISerialize  {
00053 private:
00055   friend class SvcFactory<RndmGenSvc>;
00056 
00058   typedef std::vector<const IRndmGenFactory*>  FactoryContainer;
00060   mutable IRndmEngine* m_engine;
00062   mutable ISerialize*  m_serialize;
00064   FactoryContainer     m_factories;
00066   std::string          m_engineName;
00067 protected:
00069   RndmGenSvc(const std::string& name, ISvcLocator* svc);
00071   virtual ~RndmGenSvc();
00072 
00074   StatusCode createGenerator(const IRndmGenFactory* pFactory, const IRndmGen::Param& par, IRndmGen*& refpGen);
00075   // Check the list of known factories for the requested type
00076   const IRndmGenFactory* factory(const IID& type);
00077   // Request a new factory from the object manager
00078   StatusCode requestFactory(const IID& type, const IRndmGenFactory*& refpFactory);
00079 
00080 public:
00082   StatusCode queryInterface(const IID& riid, void** ppvInterface);
00084   virtual StatusCode initialize();
00086   virtual StatusCode finalize();
00088 
00089   virtual StreamBuffer& serialize(StreamBuffer& str);
00091   virtual StreamBuffer& serialize(StreamBuffer& str) const;
00093   virtual IRndmEngine* engine();
00095   virtual StatusCode addFactory(const IRndmGenFactory* fac);
00097   virtual StatusCode removeFactory(const IID& type);
00099   virtual StatusCode generator(const IRndmGen::Param& par, IRndmGen*& refpGen);
00101   virtual double rndm() const;
00108   virtual StatusCode rndmArray( std::vector<double>& array, long howmany, long start = 0) const;
00110   virtual StatusCode setSeeds(const std::vector<long>& seeds);
00112   virtual StatusCode seeds(std::vector<long>& seeds)  const;
00113 };
00114  
00115 #endif // GAUDI_RANDOMGENSVC_RNDMGENSVC_H

Generated at Wed Nov 21 12:22:31 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000