The Gaudi Framework  v29r0 (ff2e7097)
RndmEngine.h
Go to the documentation of this file.
1 //====================================================================
2 // Random Engine definition
3 //--------------------------------------------------------------------
4 //
5 // Package : Gaudi/RndmGenSvc ( The LHCb Offline System)
6 // Author : M.Frank
7 //====================================================================
8 #ifndef GAUDI_RNDMGENSVC_RNDMENGINE_H
9 #define GAUDI_RNDMGENSVC_RNDMENGINE_H 1
10 
11 // STL include files
12 #include <vector>
13 
14 // Framework include files
17 #include "GaudiKernel/ISerialize.h"
18 #include "GaudiKernel/Service.h"
19 
20 // Forward declarations
21 class IIncidentSvc;
22 
46 class RndmEngine : public extends<Service, IRndmEngine, ISerialize, IIncidentListener>
47 {
48 protected:
51 
53  RndmEngine( const std::string& name, ISvcLocator* loc );
55  ~RndmEngine() override;
56 
57 public:
59  StatusCode initialize() override;
61  StatusCode finalize() override;
63  double rndm() const override;
70  StatusCode rndmArray( std::vector<double>& array, long howmany, long start = 0 ) const override;
75  StreamBuffer& serialize( StreamBuffer& str ) override;
80  StreamBuffer& serialize( StreamBuffer& str ) const override;
82  void handle( const Incident& inc ) override;
83 };
84 
85 #endif // GAUDI_RNDMGENSVC_RNDMENGINE_H
StreamBuffer & serialize(StreamBuffer &str) override
Input serialization from stream buffer.
Definition: RndmEngine.cpp:61
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
RndmEngine(const std::string &name, ISvcLocator *loc)
Standard Constructor.
Definition: RndmEngine.cpp:31
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
StatusCode start() override
Definition: Service.cpp:137
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
StatusCode finalize() override
Service override: finalization.
Definition: RndmEngine.cpp:53
STL class.
SmartIF< IIncidentSvc > m_pIncidentSvc
Reference to the incident service.
Definition: RndmEngine.h:50
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
StatusCode initialize() override
Service override: initialization.
Definition: RndmEngine.cpp:37
void handle(const Incident &inc) override
Inform that a new incident has occurred.
Definition: RndmEngine.cpp:70
~RndmEngine() override
Standard Destructor.
Definition: RndmEngine.cpp:34
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const override
Multiple shots returning vector with flat random numbers.
Definition: RndmEngine.cpp:78
double rndm() const override
Single shot returning single random number.
Definition: RndmEngine.cpp:67
Base class for all Incidents (computing events).
Definition: Incident.h:17
Random Generator engine definition.
Definition: RndmEngine.h:46
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23