2 #define GAUDI_RNDMGENSVC_RNDMGENGENERATORS_CPP
5 #include "GaudiKernel/SmartIF.h"
6 #include "GaudiKernel/IRndmGen.h"
7 #include "GaudiKernel/IRndmGenSvc.h"
8 #include "GaudiKernel/RndmGenerators.h"
9 #include "GaudiKernel/GaudiException.h"
19 : m_generator(copy.m_generator) {
31 throw GaudiException (
"Initialization failed !",
"Rndm::Numbers", status);
43 if ( svc.
isValid() && 0 == m_generator ) {
46 return const_cast<IRndmGenSvc*
>(svc.
get())->generator( par, m_generator );
53 if ( 0 != m_generator ) {
54 m_generator->finalize().
ignore();
55 m_generator->release();
61 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
68 throw GaudiException (
"Initialization failed !",
"Rndm::Numbers", status);
Define general base for Gaudi exception.
virtual ~Numbers()
Standard destructor.
bool isSuccess() const
Test for a status code of SUCCESS.
TYPE * get() const
Get interface pointer.
Random number accessor This small class encapsulates the use of the random number generator...
virtual StatusCode finalize()
Finalization.
Random Generator service interface definition Definition of a interface for a service to access rando...
This class is used for returning status codes from appropriate routines.
bool isValid() const
Allow for check if smart pointer is valid.
IRndmGen * m_generator
Pointer to random number generator.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
virtual StatusCode initialize(const SmartIF< IRndmGenSvc > &svc, const IRndmGen::Param &par)
Initialization.
Numbers()
Standard constructor.