ATLAS Offline Software
JaggedVecConstAccessor.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-2024 CERN for the benefit of the ATLAS collaboration.
4  */
14 #ifndef ATHCONTAINERS_JAGGEDVECCONSTACCESSOR_H
15 #define ATHCONTAINERS_JAGGEDVECCONSTACCESSOR_H
16 
17 
27 #include "CxxUtils/range_with_at.h"
29 #include <iterator>
30 
31 
32 namespace SG {
33 
34 
66 template <class PAYLOAD_T, class ALLOC>
67 class ConstAccessor<SG::JaggedVecElt<PAYLOAD_T>, ALLOC>
69 {
70 public:
72  using Payload_t = PAYLOAD_T;
73 
75  using PayloadAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<Payload_t>;
76 
79 
82 
85 
88 
91 
92 
96 
97 
99  using const_span =
101 
102 
109  ConstAccessor (const std::string& name);
110 
111 
119  ConstAccessor (const std::string& name, const std::string& clsname);
120 
121 
129 
130 
135  template <IsConstAuxElement ELT>
136  const element_type operator() (const ELT& e) const;
137 
138 
146  const element_type
147  operator() (const AuxVectorData& container, size_t index) const;
148 
149 
154  const Elt_t*
155  getEltArray (const AuxVectorData& container) const;
156 
157 
162  const Payload_t*
163  getPayloadArray (const AuxVectorData& container) const;
164 
165 
171  getEltSpan (const AuxVectorData& container) const;
172 
173 
179  getPayloadSpan (const AuxVectorData& container) const;
180 
181 
186  const_span
187  getDataSpan (const AuxVectorData& container) const;
188 
189 
190 protected:
199  ConstAccessor (const std::string& name,
200  const std::string& clsname,
201  const SG::AuxVarFlags flags);
202 
208 };
209 
210 
211 } // namespace SG
212 
213 
215 
216 
217 #endif // not ATHCONTAINERS_JAGGEDVECCONSTACCESSOR_H
SG::ConstAccessor::element_type
typename AuxDataTraits< T, ALLOC >::element_type element_type
Type the user sees.
Definition: ConstAccessor.h:58
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SG::detail::LinkedVarAccessorBase
Base class usable for accessors for variables with linked variables.
Definition: LinkedVarAccessorBase.h:29
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::const_Payload_span
typename AuxDataTraits< Payload_t >::const_span const_Payload_span
Definition: JaggedVecConstAccessor.h:95
JaggedVecVectorFactory.h
Factory object that creates vectors using AuxTypeVector, specialized for JaggedVec.
AuxElementConcepts.h
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::element_type
typename ConstConverter_t::element_type element_type
Span resulting from the conversion. This is the type the user sees.
Definition: JaggedVecConstAccessor.h:84
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::ConstAccessor
ConstAccessor(const std::string &name, const std::string &clsname)
Constructor.
SG::detail::JaggedVecConstConverter
Helper: Make a span from a jagged vector element.
Definition: JaggedVecConversions.h:49
index
Definition: index.py:1
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
SG::ConstAccessor::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::ConstAccessor
ConstAccessor(const SG::auxid_t auxid)
Constructor taking an auxid directly.
taskman.template
dictionary template
Definition: taskman.py:317
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
LinkedVarAccessorBase.h
Base class usable for accessors for variables with linked variables.
range_with_conv.h
Add to a range class conversions to containers.
JaggedVecConstAccessor.icc
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:67
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::const_container_pointer_type
void const_container_pointer_type
Not supported.
Definition: JaggedVecConstAccessor.h:90
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::const_Elt_span
typename AuxDataTraits< Elt_t, ALLOC >::const_span const_Elt_span
Spans over the objects that are actually stored.
Definition: JaggedVecConstAccessor.h:94
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::const_reference_type
element_type const_reference_type
Type referencing an item.
Definition: JaggedVecConstAccessor.h:87
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::ConstAccessor
ConstAccessor(const std::string &name, const std::string &clsname, const SG::AuxVarFlags flags)
Constructor.
AuxDataTraits.h
Allow customizing how aux data types are treated.
SG::AuxVarFlags
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypes.h:58
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::getDataSpan
const_span getDataSpan(const AuxVectorData &container) const
Get a span over spans representing the jagged vector.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::Payload_t
PAYLOAD_T Payload_t
Payload type.
Definition: JaggedVecConstAccessor.h:72
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadArray
const Payload_t * getPayloadArray(const AuxVectorData &container) const
Get a pointer to the start of the payload array.
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
SG::ConstAccessor< SG::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: JaggedVecConstAccessor.h:75
range_with_at.h
Add at() methods to a range class.
AuxTypes.h
Basic definitions for auxiliary types.
JaggedVecImpl.h
Definition of JaggedVecElt.
CxxUtils::range_with_at
Add at() methods to a range class.
Definition: range_with_at.h:33
SG::ConstAccessor::operator()
const_reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a const reference.
JaggedVecConversions.h
Conversions for accessing jagged vector variables.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadSpan
const_Payload_span getPayloadSpan(const AuxVectorData &container) const
Get a span over the payload vector.
SG::JaggedVecElt
Describe one element of a jagged vector.
Definition: JaggedVecImpl.h:132
CxxUtils::range_with_conv
Add to a range class conversions to containers.
Definition: range_with_conv.h:33
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltSpan
const_Elt_span getEltSpan(const AuxVectorData &container) const
Get a span over the array of JaggedVecElt objects.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltArray
const Elt_t * getEltArray(const AuxVectorData &container) const
Get a pointer to the start of the array of JaggedVecElt objects.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::ConstAccessor
ConstAccessor(const detail::LinkedVarAccessorBase &b)
Constructor.
AuxElement.h
Base class for elements of a container that can have aux data.
SG::ConstAccessor< SG::JaggedVecElt< PAYLOAD_T >, ALLOC >::ConstAccessor
ConstAccessor(const std::string &name)
Constructor.