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-2026 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
112 using rhs_const_reference_type = std::span<const Payload_t>;
113
117
119 using Base::operator();
120 using Base::getDataSpan;
121 using Base::getEltArray;
122 using Base::getPayloadArray;
123 using Base::getEltSpan;
124 using Base::getPayloadSpan;
125
126
133 Accessor (const std::string& name);
134
135
143 Accessor (const std::string& name, const std::string& clsname);
144
145
153
154
162 template <IsAuxElement ELT>
164
165
177
178
184 template <CxxUtils::InputRangeOverT<PAYLOAD_T> RANGE>
185 void set (AuxElement& e, const RANGE& x) const;
186
187
194 template <CxxUtils::InputRangeOverT<PAYLOAD_T> RANGE>
195 void set (AuxVectorData& container, size_t index, const RANGE& x) const;
196
197
202 Elt_t* getEltArray (AuxVectorData& container) const;
203
204
210
211
217
218
224
225
230 span getDataSpan (AuxVectorData& container) const;
231
232
238
239
245};
246
247
248} // namespace SG
249
250
252
253
254#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.
std::span< const Payload_t > rhs_const_reference_type
A const reference type that can appear on the RHS of an assignment to an application of an Accessor o...
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:484
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.