ATLAS Offline Software
Loading...
Searching...
No Matches
StoreGate/StoreGate/WriteDecorHandle.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 * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
4 */
11
12
13#ifndef STOREGATE_WRITEDECORHANDLE_H
14#define STOREGATE_WRITEDECORHANDLE_H
15
16
21#include "CxxUtils/bitmask.h"
22#include "GaudiKernel/EventContext.h"
23#include <type_traits>
24
25
26namespace SG {
27
28
97template <class T, class D>
99 : public ReadHandle<T>
100{
101public:
104
107
110
113
115 using span = typename accessor_t::span;
116
117
126
127
140 const EventContext& ctx);
141
142
143 // Disallow initialization from a temporary Key object.
144 explicit WriteDecorHandle (SG::WriteDecorHandleKey<T>&& key) = delete; // Not allowed from a temporary.
146 const EventContext& ctx) = delete; // Not allowed from a temporary.
147
148
153
154
159
160
165
166
171
172
177
178
187 bool isPresent() const;
188
189
199 virtual StatusCode setProxyDict (IProxyDict* store) override;
200
201
207
208
217
218
223 template <class POINTER_TYPE = container_pointer_type>
224 requires (!std::is_void_v<POINTER_TYPE>)
225 POINTER_TYPE
227
228
233 span
235
236
242
243
248
249
253 Gaudi::DataHandle::Mode mode() const;
254
255
259 const std::string& decorKey() const;
260
261
262private:
271 void makeDecor (const AuxVectorData* avd);
272
273
279 const SG::AuxVectorData* vectorData (std::true_type);
280
281
287 const SG::AuxVectorData* vectorData (std::false_type);
288
289
298
299
301 std::string m_decorKey;
302
305
308
311};
312
313
330template <class D, class T>
332
333
354template <class D, class T>
356 const EventContext& ctx);
357
358
366template <class T>
368template <class T>
370 const EventContext& ctx);
371
372
373} // namespace SG
374
375
377
378
379#endif // not STOREGATE_WRITEDECORHANDLE_WRITEDECORHANDLE_H
Base class for elements of a container that can have aux data.
Some common helper functions used by decoration handles.
Handle class for reading from StoreGate.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Helpers for treating a class enum as a bitmask.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
Manage lookup of vectors of auxiliary data.
typename AuxDataTraits< T, ALLOC >::span span
Definition Decorator.h:74
typename AuxDataTraits< T, ALLOC >::reference_type reference_type
Definition Decorator.h:62
typename AuxDataTraits< T, ALLOC >::container_pointer_type container_pointer_type
Definition Decorator.h:68
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
std::string store() const
Return the name of the store holding the object we are proxying.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
virtual StatusCode setProxyDict(IProxyDict *store) override
Explicitly set the event store.
WriteDecorHandle(const WriteDecorHandleKey< T > &key, const EventContext &ctx)
Constructor from a ReadDecorHandleKey and an explicit event context.
span getDecorationSpan()
Get a span over the auxilary data array, for the referenced object.
~WriteDecorHandle()
Destructor.
Gaudi::DataHandle::Mode mode() const
Return the mode (read/write/update) for this handle.
const SG::AuxVectorData * vectorData(std::true_type)
Return the referenced object as a SG::AuxVectorData.
WriteDecorHandle(WriteDecorHandle &&rhs)
Move constructor.
WriteDecorHandle(const WriteDecorHandleKey< T > &key)
Constructor from a WriteDecorHandleKey.
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
const std::string & decorKey() const
Return the name of the decoration alias (CONT.DECOR).
WriteDecorHandle(SG::WriteDecorHandleKey< T > &&key, const EventContext &ctx)=delete
reference_type operator()(const AuxElement &e)
Fetch the variable for one element, as a reference.
POINTER_TYPE getDecorationArray()
Get a pointer to the start of the auxiliary data array, for the referenced object.
const SG::AuxVectorData * vectorData(std::false_type)
Return the referenced object as a SG::AuxVectorData.
SG::auxid_t auxid() const
Return the aux id for this variable.
void makeDecor(const AuxVectorData *avd)
Create the decoration if it doesn't actually exist yet.
typename accessor_t::span span
Span of aux data items.
typename accessor_t::reference_type reference_type
Type referencing an aux data item.
WriteDecorHandle(SG::WriteDecorHandleKey< T > &&key)=delete
const SG::AuxVectorData * vectorData()
Return the referenced object as a SG::AuxVectorData.
SG::AuxElement::Decorator< D > accessor_t
Accessor type for aux data.
typename accessor_t::container_pointer_type container_pointer_type
Pointer into the vector holding an aux data item.
WriteDecorHandle(const WriteDecorHandle &rhs)
Copy constructor.
bool isPresent() const
Is the referenced container present in SG?
WriteDecorHandle & operator=(const WriteDecorHandle &rhs)
Assignment operator.
Forward declaration.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Definition index.py:1