ATLAS Offline Software
Loading...
Searching...
No Matches
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 */
12
13
14#ifndef ATHCONTAINERS_JAGGEDVECACCESSOR_H
15#define ATHCONTAINERS_JAGGEDVECACCESSOR_H
16
17
24#include "CxxUtils/ranges.h"
27#include <string>
28#include <typeinfo>
29
30
31namespace SG {
32
33
76template <class PAYLOAD_T, class ALLOC>
77class Accessor<JaggedVecElt<PAYLOAD_T>, ALLOC>
78 : public ConstAccessor<JaggedVecElt<PAYLOAD_T>, ALLOC>
79{
80public:
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
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
199
200
206
207
213
214
220
221
227
228
234
235
241};
242
243
244} // namespace SG
245
246
248
249
250#endif // not ATHCONTAINERS_JAGGEDVECACCESSOR_H
Handle mappings between names and auxid_t.
Basic definitions for auxiliary types.
Manage lookup of vectors of auxiliary data.
Helper class to provide type-safe access to aux data.
Flag that a class may have auxiliary data associated with it.
Helper class to provide constant type-safe access to aux data, specialized for JaggedVecElt.
#define x
Define macros for attributes used to control the static checker.
void set(AuxElement &e, const RANGE &x) const
Set the variable for one element.
detail::JaggedVecProxyT< Payload_t, detail::JaggedVecProxyRefBase > JVecProxyInSpan
ConstAccessor< JaggedVecElt< PAYLOAD_T >, ALLOC > Base
detail::JaggedVecProxyT< Payload_t, detail::JaggedVecProxyValBase > JVecProxy
Writable proxies for a jagged vector element: both a single proxy and one used as part of a span.
bool isAvailableWritable(AuxVectorData &c) const
Test to see if this variable exists in the store and is writable.
void set(AuxVectorData &container, size_t index, const RANGE &x) const
Set the variable for one element.
Elt_span getEltSpan(AuxVectorData &container) const
Get a span over the array of JaggedVecElt objects.
CxxUtils::transform_view_with_at< Elt_span, Converter_t > span
Span over the entire jagged vector.
typename std::allocator_traits< ALLOC >::template rebind_alloc< Payload_t > PayloadAlloc_t
Allocator to use for the payload vector.
JVecProxy reference_type
The writable type we return.
Accessor(const SG::auxid_t auxid)
Constructor taking an auxid directly.
typename AuxDataTraits< Payload_t, PayloadAlloc_t >::span Payload_span
span getDataSpan(AuxVectorData &container) const
Get a span over spans representing the jagged vector.
typename AuxDataTraits< Elt_t, ALLOC >::span Elt_span
Spans over the objects that are actually stored.
typename Base::Elt_t Elt_t
One element of the jagged vector.
bool isAvailableWritable(AuxElement &e) const
Test to see if this variable exists in the store and is writable.
detail::JaggedVecConverter< Payload_t > Converter_t
Converter from JaggedVecElt to a (writable) span.
typename Base::Payload_t Payload_t
Payload type.
Accessor(const std::string &name)
Constructor.
Elt_t * getEltArray(AuxVectorData &container) const
Get a pointer to the start of the array of JaggedVecElt objects.
Accessor(const std::string &name, const std::string &clsname)
Constructor.
Payload_t * getPayloadArray(AuxVectorData &container) const
Get a pointer to the start of the payload array.
Payload_span getPayloadSpan(AuxVectorData &container) const
Get a span over the payload vector.
reference_type operator()(ELT &e) const
Fetch the variable for one element, as a non-const reference.
CxxUtils::span< container_value_type > span
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
Manage lookup of vectors of auxiliary data.
const_span getDataSpan(const AuxVectorData &container) const
Describe one element of a jagged vector.
Helper: Make a span — either read-only or writable — from a jagged vector element.
Proxy for jagged vectors.
range_with_at< std::ranges::transform_view< SPAN, XFORM > > transform_view_with_at
Helper to add at() methods to a transform_view.
Forward declaration.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Definition index.py:1
Add at() methods to a range class.
C++20 range helpers.