ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgServices
AsgServices
ServiceHandle.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
8
9
10
#ifndef ASGSERVICES_SERVICEHANDLE_H
11
#define ASGSERVICES_SERVICEHANDLE_H
12
13
// Local include(s):
14
#ifndef XAOD_STANDALONE
15
# include "GaudiKernel/ServiceHandle.h"
16
#else
// not XAOD_STANDALONE
17
18
// System include(s):
19
#include <string>
20
#include <iosfwd>
21
22
// Local include(s):
23
#include "
AsgMessaging/StatusCode.h
"
24
#include "
AsgServices/ServiceStore.h
"
25
33
34
class
ServiceHandleBase
35
{
36
public
:
38
ServiceHandleBase(
const
std::string& typeAndName,
const
std::string& parentName );
39
41
const
std::string& typeAndName()
const
;
43
const
std::string&
type
()
const
;
45
const
std::string&
name
()
const
;
47
const
std::string&
parentName
()
const
;
48
50
void
setTypeAndName(
const
std::string& typeAndName);
52
void
setName(
const
std::string& name);
53
54
protected
:
56
std::string m_typeAndName;
58
std::string m_type;
60
std::string
m_name
;
62
std::string m_parentName;
63
64
};
// class ServiceHandleBase
65
72
73
template
<
class
T >
74
class
ServiceHandle
:
public
ServiceHandleBase
75
{
76
public
:
78
typedef
T
value_type;
79
81
ServiceHandle(
const
std::shared_ptr<T>& pservice,
82
const
std::string& parentName );
83
85
ServiceHandle(
const
std::string& servicename,
const
std::string& parentName);
86
88
template
<
typename
T2>
89
ServiceHandle (T2 *parent,
const
std::string& propertyName,
90
const
std::string& serviceName,
91
const
std::string& propertyTitle =
""
);
92
94
T
&
operator*
();
96
const
T
&
operator*
()
const
;
98
T
*
operator->
();
100
const
T
*
operator->
()
const
;
101
105
StatusCode
retrieve()
const
;
106
108
void
disable () noexcept;
109
111
bool
empty
() const;
112
114
bool
isSet() const;
115
116
private
:
118
mutable std::shared_ptr<T> m_pservice;
119
120
};
// class ServiceHandle
121
123
template< class T >
124
std::ostream& operator<< ( std::ostream& out,
125
const ServiceHandle< T >& handle );
126
127
// Include the implementation of the code:
128
#include "AsgServices/ServiceHandle.icc"
129
130
#endif
// not XAOD_STANDALONE
131
#endif
// ASGSERVICES_SERVICEHANDLE_H
operator*
ElementConstReference operator*() const
Return a reference to the referenced element.
operator->
ElementConstPointer operator->() const
Return a pointer to the referenced element.
StatusCode.h
ServiceStore.h
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
ServiceHandle
Definition
ClusterMakerTool.h:36
CxxUtils::m_name
std::string m_name
The primary name part of this expression.
Definition
CxxUtils/CxxUtils/ClassName.h:486
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TSU::T
unsigned long long T
Definition
L1TopoDataTypes.h:36
TrigCaloRecConfig.parentName
parentName
Definition
TrigCaloRecConfig.py:644
extractSporadic.name
name
Definition
extractSporadic.py:101
python.CaloAddPedShiftConfig.type
type
Definition
CaloAddPedShiftConfig.py:42
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0