Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
JaggedVecAccessor.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  */
14 #ifndef ATHCONTAINERS_JAGGEDVECACCESSOR_H
15 #define ATHCONTAINERS_JAGGEDVECACCESSOR_H
16 
17 
21 #include "AthContainers/Accessor.h"
24 #include "CxxUtils/ranges.h"
26 #include "CxxUtils/range_with_at.h"
27 #include <string>
28 #include <typeinfo>
29 
30 
31 namespace SG {
32 
33 
76 template <class PAYLOAD_T, class ALLOC>
77 class Accessor<JaggedVecElt<PAYLOAD_T>, ALLOC>
78  : public ConstAccessor<JaggedVecElt<PAYLOAD_T>, ALLOC>
79 {
80 public:
82 
84  using Payload_t = typename Base::Payload_t;
85 
87  using PayloadAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<Payload_t>;
88 
90  using Elt_t = typename Base::Elt_t;
91 
96 
99 
103 
106 
109 
113 
115  using Base::operator();
116  using Base::getDataSpan;
117  using Base::getEltArray;
118  using Base::getPayloadArray;
119  using Base::getEltSpan;
120  using Base::getPayloadSpan;
121 
122 
129  Accessor (const std::string& name);
130 
131 
139  Accessor (const std::string& name, const std::string& clsname);
140 
141 
149 
150 
158  template <IsAuxElement ELT>
160 
161 
172  reference_type operator() (AuxVectorData& container, size_t index) const;
173 
174 
180  template <CxxUtils::InputRangeOverT<PAYLOAD_T> RANGE>
181  void set (AuxElement& e, const RANGE& x) const;
182 
183 
190  template <CxxUtils::InputRangeOverT<PAYLOAD_T> RANGE>
191  void set (AuxVectorData& container, size_t index, const RANGE& x) const;
192 
193 
198  Elt_t* getEltArray (AuxVectorData& container) const;
199 
200 
206 
207 
212  Elt_span getEltSpan (AuxVectorData& container) const;
213 
214 
220 
221 
226  span getDataSpan (AuxVectorData& container) const;
227 
228 
234 
235 
241 };
242 
243 
244 } // namespace SG
245 
246 
248 
249 
250 #endif // not ATHCONTAINERS_JAGGEDVECACCESSOR_H
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SG::detail::JaggedVecProxyT
Proxy for jagged vectors.
Definition: JaggedVecConversions.h:250
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IAuxElement.h
Flag that a class may have auxiliary data associated with it.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadSpan
Payload_span getPayloadSpan(AuxVectorData &container) const
Get a span over the payload vector.
index
Definition: index.py:1
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
SG::ConstAccessor< T, AuxAllocator_t< T > >::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
taskman.template
dictionary template
Definition: taskman.py:317
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::set
void set(AuxVectorData &container, size_t index, const RANGE &x) const
Set the variable for one element.
JaggedVecAccessor.icc
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Elt_t
typename Base::Elt_t Elt_t
One element of the jagged vector.
Definition: JaggedVecAccessor.h:90
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::set
void set(AuxElement &e, const RANGE &x) const
Set the variable for one element.
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
x
#define x
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:61
SG::detail::JaggedVecConverter
Helper: Make a span — either read-only or writable — from a jagged vector element.
Definition: JaggedVecConversions.h:692
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Payload_span
typename AuxDataTraits< Payload_t, PayloadAlloc_t >::span Payload_span
Definition: JaggedVecAccessor.h:102
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::const_container_pointer_type
void const_container_pointer_type
Definition: JaggedVecAccessor.h:112
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::getDataSpan
span getDataSpan(AuxVectorData &container) const
Get a span over spans representing the jagged vector.
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Accessor
Accessor(const std::string &name, const std::string &clsname)
Constructor.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Elt_span
typename AuxDataTraits< Elt_t, ALLOC >::span Elt_span
Spans over the objects that are actually stored.
Definition: JaggedVecAccessor.h:101
SG::Accessor::operator()
reference_type operator()(ELT &e) const
Fetch the variable for one element, as a non-const reference.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Accessor
Accessor(const std::string &name)
Constructor.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Accessor
Accessor(const SG::auxid_t auxid)
Constructor taking an auxid directly.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltArray
Elt_t * getEltArray(AuxVectorData &container) const
Get a pointer to the start of the array of JaggedVecElt objects.
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::PayloadAlloc_t
typename std::allocator_traits< ALLOC >::template rebind_alloc< Payload_t > PayloadAlloc_t
Allocator to use for the payload vector.
Definition: JaggedVecAccessor.h:87
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Accessor.h
Helper class to provide type-safe access to aux data.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::isAvailableWritable
bool isAvailableWritable(AuxElement &e) const
Test to see if this variable exists in the store and is writable.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::isAvailableWritable
bool isAvailableWritable(AuxVectorData &c) const
Test to see if this variable exists in the store and is writable.
range_with_at.h
Add at() methods to a range class.
AuxTypes.h
Basic definitions for auxiliary types.
CxxUtils::range_with_at
Add at() methods to a range class.
Definition: range_with_at.h:33
JaggedVecConstAccessor.h
Helper class to provide constant type-safe access to aux data, specialized for JaggedVecElt.
SG::JaggedVecElt
Describe one element of a jagged vector.
Definition: JaggedVecImpl.h:132
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltSpan
Elt_span getEltSpan(AuxVectorData &container) const
Get a span over the array of JaggedVecElt objects.
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::container_pointer_type
void container_pointer_type
Not supported.
Definition: JaggedVecAccessor.h:111
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadArray
Payload_t * getPayloadArray(AuxVectorData &container) const
Get a pointer to the start of the payload array.
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
ranges.h
C++20 range helpers.
checker_macros.h
Define macros for attributes used to control the static checker.
python.compressB64.c
def c
Definition: compressB64.py:93
SG::Accessor< JaggedVecElt< PAYLOAD_T >, ALLOC >::Payload_t
typename Base::Payload_t Payload_t
Payload type.
Definition: JaggedVecAccessor.h:84