ATLAS Offline Software
Loading...
Searching...
No Matches
LArCalorimeter
LArGeoModel
LArGeoCode
src
VDetectorParameters.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
// DetectorParameters
7
// 30-Jun-2003 Bill Seligman (WGS)
8
9
// This routine implements a modified version of the singleton
10
// pattern. It's initialized with a pointer to some class that
11
// inherits from this one; thereafter that pointer can be accessed
12
// from any routine in the simulation.
13
14
// Note: we're using the LArGeo namespace, which is why LArGeo:: is in
15
// front of so many names.
16
17
#include "
LArGeoCode/VDetectorParameters.h
"
18
#include <cstdlib>
19
#include <iostream>
20
21
22
CxxUtils::CachedUniquePtr<LArGeo::VDetectorParameters>
LArGeo::VDetectorParameters::s_instance;
23
24
void
LArGeo::VDetectorParameters::SetInstance
(std::unique_ptr<VDetectorParameters> p)
25
{
26
s_instance.set (std::move (p));
27
}
28
29
const
LArGeo::VDetectorParameters
*
LArGeo::VDetectorParameters::GetInstance
()
30
{
31
const
VDetectorParameters
* p = s_instance.get();
32
if
(p==
nullptr
)
33
std::cerr <<
"LArGeo::VDetectorParameters::GetInstance was called, but "
34
<<
"the pointer to the detector-parameter access object is 0."
35
<< std::endl;
36
37
return
p;
38
}
VDetectorParameters.h
LArGeo::VDetectorParameters
Definition
VDetectorParameters.h:29
LArGeo::VDetectorParameters::GetInstance
static const VDetectorParameters * GetInstance()
Definition
VDetectorParameters.cxx:29
LArGeo::VDetectorParameters::SetInstance
static void SetInstance(std::unique_ptr< VDetectorParameters >)
Definition
VDetectorParameters.cxx:24
LArGeo::VDetectorParameters::VDetectorParameters
VDetectorParameters()
Definition
VDetectorParameters.h:61
CxxUtils::CachedUniquePtr
CachedUniquePtrT< const T > CachedUniquePtr
Definition
CachedUniquePtr.h:114
Generated on
for ATLAS Offline Software by
1.14.0