ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgDataHandles
AsgDataHandles
AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3
/*
4
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5
*/
6
13
14
#ifndef ASG_DATA_HANDLES_READ_HANDLE_H
15
#define ASG_DATA_HANDLES_READ_HANDLE_H
16
17
18
#ifndef XAOD_STANDALONE
19
#include <
StoreGate/ReadHandle.h
>
20
#else
21
22
#include "
AsgDataHandles/VarHandleBase.h
"
23
// #include "AsgDataHandles/ReadHandleKey.h"
24
25
26
27
namespace
SG
{
28
template
<
class
T>
class
ReadHandleKey
;
29
30
37
template
<
class
T>
38
class
ReadHandle
39
:
public
SG::VarHandleBase
40
{
41
public
:
42
typedef
T
*
pointer_type
;
// FIXME: better handling of
43
typedef
const
T
*
const_pointer_type
;
// qualified T type ?
44
typedef
T
&
reference_type
;
45
typedef
const
T
&
const_reference_type
;
46
47
48
//************************************************************************
49
// Constructors, etc.
50
//
51
52
58
ReadHandle
() =
default
;
59
60
65
explicit
ReadHandle
(
const
std::string& sgkey);
66
67
75
explicit
ReadHandle
(
const
ReadHandleKey<T>&
key
);
76
77
89
explicit
ReadHandle
(
const
ReadHandleKey<T>&
key
,
const
EventContext& ctx);
90
91
92
//************************************************************************
93
// Dereference.
94
//
95
96
101
const_pointer_type
operator->
();
102
103
108
const_reference_type
operator*
();
109
110
115
const_pointer_type
cptr
();
116
117
122
const_pointer_type
ptr
();
123
124
128
bool
isValid
();
129
130
134
const_pointer_type
get
()
const
;
135
136
141
const_pointer_type
get
(
const
EventContext& ctx)
const
;
142
143
149
bool
isPresent
()
const
;
150
151
158
bool
isPresent_impl
(
const
std::string&
key
)
const
;
159
160
161
protected
:
167
explicit
ReadHandle
(
const
VarHandleKey&
key
,
const
EventContext* ctx);
168
169
170
private
:
175
const_pointer_type
checkedCPtr
();
176
180
const_pointer_type
getCPtr()
const
;
181
};
182
183
191
template
<
class
T>
192
ReadHandle<T>
makeHandle
(
const
ReadHandleKey<T>
& key);
193
194
206
template
<
class
T>
207
ReadHandle<T>
makeHandle
(
const
ReadHandleKey<T>
& key,
208
const
EventContext& ctx);
209
210
217
template
<
class
T>
218
const
T
*
get
(
const
ReadHandleKey<T>
& key);
219
220
221
229
template
<
class
T>
230
const
T
*
get
(
const
ReadHandleKey<T>
& key,
231
const
EventContext& ctx);
232
233
234
}
/* namespace SG */
235
236
237
238
#include "
AsgDataHandles/ReadHandle.icc
"
239
240
#endif
241
242
#endif
//> !STOREGATE_SG_READHANDLE_H
ReadHandle.icc
VarHandleBase.h
Base class for VarHandle classes.
ReadHandle.h
Handle class for reading from StoreGate.
IResetable::key
virtual const std::string & key() const =0
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::const_reference_type
const T & const_reference_type
Definition
StoreGate/StoreGate/ReadHandle.h:72
SG::ReadHandle::const_pointer_type
const T * const_pointer_type
Definition
StoreGate/StoreGate/ReadHandle.h:70
SG::ReadHandle::pointer_type
T * pointer_type
Definition
StoreGate/StoreGate/ReadHandle.h:69
SG::ReadHandle::reference_type
T & reference_type
Definition
StoreGate/StoreGate/ReadHandle.h:71
SG::ReadHandle::ptr
const_pointer_type ptr()
Dereference the pointer.
SG::ReadHandle::ReadHandle
ReadHandle()
Default constructor.
SG::ReadHandle::checkedCPtr
const_pointer_type checkedCPtr()
Helper: dereference the pointer.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::operator->
const_pointer_type operator->()
Dereference the pointer.
SG::ReadHandle::operator*
const_reference_type operator*()
Dereference the pointer.
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
SG::VarHandleBase::isPresent_impl
bool isPresent_impl(const std::string &key) const
Is the referenced object present in SG?
Definition
StoreGate/src/VarHandleBase.cxx:1114
SG::VarHandleBase::isPresent
bool isPresent() const
Is the referenced object present in SG?
Definition
StoreGate/src/VarHandleBase.cxx:400
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition
ReadCondHandle.h:282
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
TSU::T
unsigned long long T
Definition
L1TopoDataTypes.h:36
Generated on
for ATLAS Offline Software by
1.17.0