ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgTools
AsgTools
ToolHandle.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ASGTOOLS_TOOLHANDLE_H
6
#define ASGTOOLS_TOOLHANDLE_H
7
8
// Local include(s):
9
#ifndef XAOD_STANDALONE
10
# include "GaudiKernel/ToolHandle.h"
11
#else
// not XAOD_STANDALONE
12
13
// System include(s):
14
#include <string>
15
#include <iosfwd>
16
17
// Local include(s):
18
#include "
AsgMessaging/StatusCode.h
"
19
20
class
INamedInterface;
21
33
class
ToolHandleBase {
34
35
public
:
37
ToolHandleBase(
const
std::string& typeAndName =
""
, INamedInterface* parent = 0 );
38
40
const
std::string& typeAndName()
const
;
42
const
std::string&
type
()
const
;
44
const
std::string&
name
()
const
;
46
const
std::string&
parentName
()
const
;
48
INamedInterface *
parent
() const noexcept;
49
51
void
setTypeAndName(const std::
string
& typeAndName);
53
void
setName(const std::
string
& name);
54
55
protected
:
57
std::
string
m_typeAndName;
59
std::
string
m_type;
61
std::
string
m_name;
63
INamedInterface *m_parent;
64
65
};
// class ToolHandleBase
66
78
template< class T >
79
class ToolHandle : public ToolHandleBase {
80
81
public
:
83
typedef
T
value_type;
84
86
ToolHandle( T* ptool = 0 );
87
89
ToolHandle(
const
std::string& toolname, INamedInterface* parent = 0 );
90
92
template
<
typename
T2>
93
ToolHandle (T2 *parent,
const
std::string& propertyName,
94
const
std::string& toolName,
95
const
std::string& propertyTitle =
""
);
96
98
T
&
operator*
();
100
const
T
&
operator*
()
const
;
102
T
*
operator->
();
104
const
T
*
operator->
()
const
;
105
109
StatusCode
retrieve()
const
;
110
112
void
disable () noexcept;
113
115
bool
empty
() const;
116
118
bool
isSet() const;
119
120
private
:
122
mutable T* m_ptool {
nullptr
};
123
124
};
// class ToolHandle
125
127
template
<
class
T >
128
std::ostream&
operator<<
( std::ostream& out,
129
const
ToolHandle< T >& handle );
130
131
// Include the implementation of the code:
132
#include "
AsgTools/ToolHandle.icc
"
133
134
#endif
// not XAOD_STANDALONE
135
#endif
// ASGTOOLS_TOOLHANDLE_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
operator<<
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
Definition
TestGaudiProperty.cxx:69
ToolHandle.icc
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
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
test_pyathena.parent
parent
Definition
test_pyathena.py:15
protected
#define protected
Definition
testRead.cxx:26
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0