The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
RndmGenerators.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
15#include <GaudiKernel/SmartIF.h>
16
17// Construct and initialize the generator
19 StatusCode status = initialize( svc, par );
20 if ( !status.isSuccess() ) { throw GaudiException( "Initialization failed !", "Rndm::Numbers", status ); }
21}
22
23// Standard destructor
25
26// Initialize the generator
28 if ( svc && !m_generator ) m_generator = svc->generator( par );
30}
31
32// Initialize the generator
34 if ( m_generator ) {
35 m_generator->finalize().ignore();
36 m_generator.reset();
37 }
39}
Define general base for Gaudi exception.
virtual StatusCode initialize(const SmartIF< IRndmGenSvc > &svc, const IRndmGen::Param &par)
Initialization.
virtual ~Numbers()
Standard destructor.
virtual StatusCode finalize()
Finalization.
Numbers()=default
Standard constructor.
SmartIF< IRndmGen > m_generator
Pointer to random number generator.
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100