All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
15 #include "GaudiKernel/Service.h"
16 #include "GaudiKernel/ISerialize.h"
19 
20 // Forward declarations
21 class IIncidentSvc;
22 
46 class RndmEngine: public extends<Service,
47  IRndmEngine,
48  ISerialize,
49  IIncidentListener>
50 {
51 protected:
54 
56  RndmEngine(const std::string& name, ISvcLocator* loc);
58  ~RndmEngine() override;
59 public:
61  StatusCode initialize() override;
63  StatusCode finalize() override;
65  double rndm() const override;
72  StatusCode rndmArray( std::vector<double>& array, long howmany, long start = 0) const override;
77  StreamBuffer& serialize(StreamBuffer& str) override;
82  StreamBuffer& serialize(StreamBuffer& str) const override;
84  void handle(const Incident& inc) override;
85 };
86 
87 #endif // GAUDI_RNDMGENSVC_RNDMENGINE_H
StreamBuffer & serialize(StreamBuffer &str) override
Input serialization from stream buffer.
Definition: RndmEngine.cpp:63
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:56
STL class.
SmartIF< IIncidentSvc > m_pIncidentSvc
Reference to the incident service.
Definition: RndmEngine.h:53
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode initialize() override
Service override: initialization.
Definition: RndmEngine.cpp:41
void handle(const Incident &inc) override
Inform that a new incident has occurred.
Definition: RndmEngine.cpp:78
~RndmEngine() override
Standard Destructor.
Definition: RndmEngine.cpp:37
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:87
double rndm() const override
Single shot returning single random number.
Definition: RndmEngine.cpp:73
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