Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
JaggedVecDecorator.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_JAGGEDVECDECORATOR_H
15 #define ATHCONTAINERS_JAGGEDVECDECORATOR_H
16 
17 
28 #include "CxxUtils/ranges.h"
30 #include "CxxUtils/range_with_at.h"
32 #include <string>
33 #include <typeinfo>
34 #include <iterator>
35 
36 
37 namespace SG {
38 
39 
75 template <class PAYLOAD_T, class ALLOC>
76 class Decorator<JaggedVecElt<PAYLOAD_T>, ALLOC>
78 {
79 public:
81  using Payload_t = PAYLOAD_T;
82 
84  using PayloadAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<Payload_t>;
85 
88 
93 
96 
99 
105 
109 
112 
115 
119 
120 
127  Decorator (const std::string& name);
128 
129 
137  Decorator (const std::string& name, const std::string& clsname);
138 
139 
147 
148 
160  template <IsConstAuxElement ELT>
161  reference_type operator() (const ELT& e) const;
162 
163 
179  operator() (const AuxVectorData& container, size_t index) const;
180 
181 
187  template <IsConstAuxElement ELT,
188  CxxUtils::InputRangeOverT<PAYLOAD_T> RANGE>
189  void set (const ELT& e, const RANGE& x) const;
190 
191 
198  template <CxxUtils::InputRangeOverT<PAYLOAD_T> RANGE>
199  void set (const AuxVectorData& container, size_t index, const RANGE& x) const;
200 
201 
206  const Elt_t* getEltArray (const AuxVectorData& container) const;
207 
208 
213  const Payload_t* getPayloadArray (const AuxVectorData& container) const;
214 
215 
225  Elt_t* getEltDecorArray (const AuxVectorData& container) const;
226 
227 
237  Payload_t* getPayloadDecorArray (const AuxVectorData& container) const;
238 
239 
245  getEltSpan (const AuxVectorData& container) const;
246 
247 
253  getPayloadSpan (const AuxVectorData& container) const;
254 
255 
260  const_span
261  getDataSpan (const AuxVectorData& container) const;
262 
263 
273  Elt_span
274  getEltDecorSpan (const AuxVectorData& container) const;
275 
276 
287  getPayloadDecorSpan (const AuxVectorData& container) const;
288 
289 
299  span
300  getDecorationSpan (const AuxVectorData& container) const;
301 
302 
307  template <IsConstAuxElement ELT>
308  bool isAvailableWritable (const ELT& e) const;
309 
310 
315  bool isAvailableWritable (const AuxVectorData& c) const;
316 
317 
318 protected:
327  Decorator (const std::string& name,
328  const std::string& clsname,
329  const SG::AuxVarFlags flags);
330 };
331 
332 
333 } // namespace SG
334 
335 
337 
338 
339 #endif // not ATHCONTAINERS_JAGGEDVECDECORATOR_H
JaggedVecDecorator.icc
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::detail::JaggedVecProxyT
Proxy for jagged vectors.
Definition: JaggedVecConversions.h:250
JaggedVecVectorFactory.h
Factory object that creates vectors using AuxTypeVector, specialized for JaggedVec.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Elt_span
typename AuxDataTraits< JaggedVecElt< Payload_t >, ALLOC >::span Elt_span
Definition: JaggedVecDecorator.h:103
AuxElementConcepts.h
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Decorator
Decorator(const std::string &name)
Constructor.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IAuxElement.h
Flag that a class may have auxiliary data associated with it.
SG::detail::JaggedVecConstConverter
Helper: Make a span from a jagged vector element.
Definition: JaggedVecConversions.h:48
index
Definition: index.py:1
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Decorator
Decorator(const SG::auxid_t auxid)
Constructor taking an auxid directly.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltDecorSpan
Elt_span getEltDecorSpan(const AuxVectorData &container) const
Get a span over the array of JaggedVecElt objects, as a decoration.
taskman.template
dictionary template
Definition: taskman.py:317
SG::Decorator::span
typename AuxDataTraits< T, ALLOC >::span span
A span over elements in the container.
Definition: Decorator.h:74
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::element_type
typename ConstConverter_t::element_type element_type
Const span resulting from the conversion.
Definition: JaggedVecDecorator.h:111
SG::Decorator::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltSpan
const_Elt_span getEltSpan(const AuxVectorData &container) const
Get a span over the array of JaggedVecElt objects.
x
#define x
range_with_conv.h
Add to a range class conversions to containers.
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:61
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getDataSpan
const_span getDataSpan(const AuxVectorData &container) const
Get a span over spans representing the jagged vector.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getDecorationSpan
span getDecorationSpan(const AuxVectorData &container) const
Get a span over spans representing the jagged vector, as a decoration.
SG::detail::JaggedVecConverter
Helper: Make a span — either read-only or writable — from a jagged vector element.
Definition: JaggedVecConversions.h:692
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::container_pointer_type
void container_pointer_type
Not supported.
Definition: JaggedVecDecorator.h:117
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadDecorSpan
Payload_span getPayloadDecorSpan(const AuxVectorData &container) const
Get a span over the payload vector, as a decoration.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Decorator
Decorator(const std::string &name, const std::string &clsname, const SG::AuxVarFlags flags)
Constructor.
SG::Decorator< 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: JaggedVecDecorator.h:84
SG::Decorator::operator()
reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a non-const reference.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::const_Elt_span
typename AuxDataTraits< JaggedVecElt< Payload_t >, ALLOC >::const_span const_Elt_span
Spans over the objects that are actually stored.
Definition: JaggedVecDecorator.h:101
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Payload_span
typename AuxDataTraits< Payload_t, PayloadAlloc_t >::span Payload_span
Definition: JaggedVecDecorator.h:104
SG::AuxDataTraits
Allow customizing how aux data types are treated.
Definition: AuxDataTraits.h:40
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadArray
const Payload_t * getPayloadArray(const AuxVectorData &container) const
Get a pointer to the start of the payload array.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::isAvailableWritable
bool isAvailableWritable(const ELT &e) const
Test to see if this variable exists in the store and is writable.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::set
void set(const AuxVectorData &container, size_t index, const RANGE &x) const
Set the variable for one element.
SG::Decorator< 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::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Decorator
Decorator(const std::string &name, const std::string &clsname)
Constructor.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadDecorArray
Payload_t * getPayloadDecorArray(const AuxVectorData &container) const
Get a pointer to the start of the payload array, as a decoration.
SG::AuxVarFlags
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypes.h:58
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getPayloadSpan
const_Payload_span getPayloadSpan(const AuxVectorData &container) const
Get a span over the payload vector.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::Payload_t
PAYLOAD_T Payload_t
Payload type.
Definition: JaggedVecDecorator.h:81
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
JaggedVecConversions.h
Conversions for accessing jagged vector variables.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::isAvailableWritable
bool isAvailableWritable(const AuxVectorData &c) const
Test to see if this variable exists in the store and is writable.
SG::Decorator::const_span
typename AuxDataTraits< T, ALLOC >::const_span const_span
Definition: Decorator.h:75
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::getEltDecorArray
Elt_t * getEltDecorArray(const AuxVectorData &container) const
Get a pointer to the start of the array of JaggedVecElt objects, as a decoration.
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
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::set
void set(const ELT &e, const RANGE &x) const
Set the variable for one element.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::const_Payload_span
typename AuxDataTraits< Payload_t, PayloadAlloc_t >::const_span const_Payload_span
Definition: JaggedVecDecorator.h:102
CxxUtils::range_with_conv
Add to a range class conversions to containers.
Definition: range_with_conv.h:30
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
ranges.h
C++20 range helpers.
SG::Decorator< JaggedVecElt< PAYLOAD_T >, ALLOC >::const_container_pointer_type
void const_container_pointer_type
Definition: JaggedVecDecorator.h:118
checker_macros.h
Define macros for attributes used to control the static checker.
python.compressB64.c
def c
Definition: compressB64.py:93
Decorator.h
Helper class to provide type-safe access to aux data.
SG::IsConstAuxElement
concept IsConstAuxElement
Test if T is compatible with ConstAuxElement.
Definition: AuxElementConcepts.h:34