ATLAS Offline Software
Loading...
Searching...
No Matches
Decorator.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-2026 CERN for the benefit of the ATLAS collaboration.
4 */
15
16
17#ifndef ATHCONTAINERS_DECORATOR_H
18#define ATHCONTAINERS_DECORATOR_H
19
20
26#include <string>
27#include <typeinfo>
28
29
30namespace SG {
31
32
57template <class T, class ALLOC = AuxAllocator_t<T> >
58class Decorator
59{
60public:
63
65 using const_reference_type =
67
70 using rhs_const_reference_type = const_reference_type;
71
74
80
82 using span = typename AuxDataTraits<T, ALLOC>::span;
84
85
92 Decorator (const std::string& name);
93
94
102 Decorator (const std::string& name, const std::string& clsname);
103
104
112
113
122 template <IsConstAuxElement ELT>
123 reference_type operator() (const ELT& e) const;
124
125
141
142
148 template <IsConstAuxElement ELT>
149 void set (const ELT& e, const element_type& x) const;
150
151
157
158
168
169
176
177
186 span
188
189
194 template <IsConstAuxElement ELT>
195 bool isAvailable (const ELT& e) const;
196
197
202 template <IsConstAuxElement ELT>
203 bool isAvailableWritable (const ELT& e) const;
204
205
210 bool isAvailable (const AuxVectorData& c) const;
211
212
217 bool isAvailableWritable (const AuxVectorData& c) const;
218
219
224
225
226protected:
235 Decorator (const std::string& name,
236 const std::string& clsname,
237 const SG::AuxVarFlags flags);
238
239
248 const SG::AuxVarFlags flags);
249
250
251private:
254};
255
256
257} // namespace SG
258
259
261
262
263#endif // not ATHCONTAINERS_DECORATOR_H
Handle mappings between names and auxid_t.
Basic definitions for auxiliary types.
Manage lookup of vectors of auxiliary data.
Flag that a class may have auxiliary data associated with it.
#define x
typename vector_type::pointer container_pointer_type
Pointers to the data within the container.
CxxUtils::span< container_value_type > span
CxxUtils::span< const container_value_type > const_span
element_type & reference_type
Reference types returned by aux data accessors.
T element_type
The type the user sees.
typename vector_type::const_pointer const_container_pointer_type
const element_type & const_reference_type
Manage lookup of vectors of auxiliary data.
Forward declaration.
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition AuxTypes.h:58
SG::auxid_t m_auxid
The cached auxid.
Definition Decorator.h:253
const_container_pointer_type getDataArray(const AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
SG::auxid_t auxid() const
Return the aux id for this variable.
void set(const ELT &e, const element_type &x) const
Set the variable for one element.
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if an aux variable is available for reading.
reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a non-const reference.
CxxUtils::transform_view_with_at< PackedLinkVector_span, ELSpanConverter > span
void const_container_pointer_type
container_pointer_type getDecorationArray(const AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
elt_span reference_type
Type referencing an item.
const SG::AuxVectorData * container() const
Return the container holding this element.
CxxUtils::transform_view_with_at< const_PackedLinkVector_span, ConstVectorTransform_t > const_span
Helper class to provide constant type-safe access to aux data, specialized for a vector of PackedLink...
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable(const std::string &name, const std::string &clsname="")
Check if an aux variable is available for writing.
const_span getDataSpan(const AuxVectorData &container) const
Get a span over the auxiliary data array.
elt_span element_type
Type the user sees.
span getDecorationSpan(const AuxVectorData &container) const
Get a span over the auxiliary data array.
void container_pointer_type
Not supported.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Definition index.py:1