ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
StoreGate
StoreGate
StoreGate/StoreGate/HandleKeyArray.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef STOREGATE_HANDLEKEYARRAY_H
6
#define STOREGATE_HANDLEKEYARRAY_H 1
7
8
#include "
StoreGate/VarHandleKeyArray.h
"
9
#include "GaudiKernel/EventContext.h"
10
#include "GaudiKernel/ThreadLocalContext.h"
11
12
#include <vector>
13
#include <string>
14
15
namespace
SG
{
16
43
44
template
<
class
T_Handle,
class
T_HandleKey, Gaudi::DataHandle::Mode MODE>
45
class
HandleKeyArray
:
public
VarHandleKeyArrayCommon
< T_HandleKey > {
46
public
:
50
HandleKeyArray
(){}
51
57
HandleKeyArray
(
const
std::vector<T_HandleKey>& v ) :
58
VarHandleKeyArrayCommon
<T_HandleKey> ( v ) {}
59
65
HandleKeyArray
( std::initializer_list<T_HandleKey> l ):
66
VarHandleKeyArrayCommon
<T_HandleKey> {l} {}
67
74
HandleKeyArray
( std::initializer_list<std::string> key_names):
75
VarHandleKeyArrayCommon
<T_HandleKey> {key_names} {}
76
87
template
<
class
T = T_HandleKey>
88
requires
T::isDecorHandleKey
89
HandleKeyArray
(
VarHandleKey
& contKey,
90
std::initializer_list<std::string> key_names ):
91
VarHandleKeyArrayCommon
<T_HandleKey> {contKey, key_names} {}
92
102
template
<std::derived_from<IProperty> OWNER>
103
inline
HandleKeyArray
( OWNER*
owner
,
104
std::string name,
105
std::initializer_list<std::string> l,
106
std::string doc=
""
) :
107
VarHandleKeyArrayCommon
<T_HandleKey> {l} {
108
auto
p =
owner
->declareProperty(std::move(name), *
this
, std::move(doc));
109
p->template setOwnerType<OWNER>();
110
}
111
112
126
template
<std::derived_from<IProperty> OWNER,
class
T = T_HandleKey>
127
requires
T::isDecorHandleKey
128
inline
HandleKeyArray
( OWNER*
owner
,
129
std::string name,
130
VarHandleKey
& contKey,
131
std::initializer_list<std::string> l,
132
std::string doc=
""
) :
133
VarHandleKeyArrayCommon
<T_HandleKey> {contKey, l} {
134
auto
p =
owner
->declareProperty(std::move(name), *
this
, std::move(doc));
135
p->template setOwnerType<OWNER>();
136
}
137
138
142
virtual
Gaudi::DataHandle::Mode
mode
()
const override
{
return
MODE
; }
143
148
std::vector< T_Handle >
makeHandles
()
const
{
149
const
EventContext& ctx = Gaudi::Hive::currentContext();
150
std::vector< T_Handle > hndl;
151
for
(
const
T_HandleKey& k : *
this
) {
152
hndl.emplace_back ( k, ctx );
153
}
154
return
hndl;
155
}
156
161
std::vector< T_Handle >
makeHandles
(
const
EventContext& ctx)
const
162
{
163
std::vector< T_Handle > hndl;
164
for
(
const
T_HandleKey& k : *
this
) {
165
hndl.emplace_back ( k, ctx);
166
}
167
return
hndl;
168
}
169
170
};
171
172
}
// namespace SG
173
174
#endif
MODE
#define MODE
Definition
CellClusterLinkTool.h:24
VarHandleKeyArray.h
Base class for VarHandleKeyArray for reading from StoreGate.
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray(OWNER *owner, std::string name, VarHandleKey &contKey, std::initializer_list< std::string > l, std::string doc="")
auto-declaring Property Constructor from a HandleKeyArray that takes an initializer list of std::stri...
Definition
StoreGate/StoreGate/HandleKeyArray.h:128
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray(VarHandleKey &contKey, std::initializer_list< std::string > key_names)
base Constructor that takes an associated container and an initializer list of std::strings.
Definition
StoreGate/StoreGate/HandleKeyArray.h:89
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray(const std::vector< T_HandleKey > &v)
Constructor from a HandleKeyArray that takes a vector of ReadHandleKeys.
Definition
StoreGate/StoreGate/HandleKeyArray.h:57
SG::HandleKeyArray::makeHandles
std::vector< T_Handle > makeHandles(const EventContext &ctx) const
create a vector of Handles from the HandleKeys in the array, with explicit EventContext.
Definition
StoreGate/StoreGate/HandleKeyArray.h:161
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray(OWNER *owner, std::string name, std::initializer_list< std::string > l, std::string doc="")
auto-declaring Property Constructor from a HandleKeyArray that takes an initializer list of std::stri...
Definition
StoreGate/StoreGate/HandleKeyArray.h:103
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray()
default Constructor from a HandleKeyArray
Definition
StoreGate/StoreGate/HandleKeyArray.h:50
SG::HandleKeyArray::makeHandles
std::vector< T_Handle > makeHandles() const
create a vector of Handles from the HandleKeys in the array
Definition
StoreGate/StoreGate/HandleKeyArray.h:148
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray(std::initializer_list< std::string > key_names)
Constructor from a HandleKeyArray that takes an initializer list of std::strings.
Definition
StoreGate/StoreGate/HandleKeyArray.h:74
SG::HandleKeyArray::mode
virtual Gaudi::DataHandle::Mode mode() const override
return the type (Read/Write/Update) of handle
Definition
StoreGate/StoreGate/HandleKeyArray.h:142
SG::HandleKeyArray::HandleKeyArray
HandleKeyArray(std::initializer_list< T_HandleKey > l)
Constructor from a HandleKeyArray that takes an initializer list of HandleKeys.
Definition
StoreGate/StoreGate/HandleKeyArray.h:65
SG::HandleKeyArray< ReadCondHandle< T >, CondHandleDefault::Key< ReadCondHandleKey< T > >, Gaudi::DataHandle::Reader >::owner
virtual const IDataHandleHolder * owner() const override
Definition
StoreGate/StoreGate/VarHandleKeyArray.h:163
SG::VarHandleKeyArrayCommon< T_HandleKey >::VarHandleKeyArrayCommon
VarHandleKeyArrayCommon()
Definition
StoreGate/StoreGate/VarHandleKeyArray.h:69
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition
StoreGate/StoreGate/VarHandleKey.h:59
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Generated on
for ATLAS Offline Software by
1.17.0