ATLAS Offline Software
Loading...
Searching...
No Matches
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 */
12
13
14#ifndef ATHCONTAINERS_JAGGEDVECCONSTACCESSOR_H
15#define ATHCONTAINERS_JAGGEDVECCONSTACCESSOR_H
16
17
29#include <iterator>
30
31
32namespace SG {
33
34
66template <class PAYLOAD_T, class ALLOC>
67class ConstAccessor<SG::JaggedVecElt<PAYLOAD_T>, ALLOC>
69{
70public:
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
148
149
154 const Elt_t*
156
157
162 const Payload_t*
164
165
172
173
180
181
188
189
190protected:
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
Allow customizing how aux data types are treated.
Base class for elements of a container that can have aux data.
Basic definitions for auxiliary types.
Helper class to provide constant type-safe access to aux data.
Conversions for accessing jagged vector variables.
Definition of JaggedVecElt.
Factory object that creates vectors using AuxTypeVector, specialized for JaggedVec.
Base class usable for accessors for variables with linked variables.
CxxUtils::span< const container_value_type > const_span
Manage lookup of vectors of auxiliary data.
ConstAccessor(const std::string &name)
Constructor.
CxxUtils::transform_view_with_at< const_Elt_span, ConstConverter_t > const_span
Transform a span over elements to a span of spans.
typename AuxDataTraits< Elt_t, ALLOC >::const_span const_Elt_span
Spans over the objects that are actually stored.
ConstAccessor(const std::string &name, const std::string &clsname)
Constructor.
const_span getDataSpan(const AuxVectorData &container) const
Get a span over spans representing the jagged vector.
const_Payload_span getPayloadSpan(const AuxVectorData &container) const
Get a span over the payload vector.
typename AuxDataTraits< Payload_t >::const_span const_Payload_span
typename ConstConverter_t::element_type element_type
Span resulting from the conversion. This is the type the user sees.
ConstAccessor(const std::string &name, const std::string &clsname, const SG::AuxVarFlags flags)
Constructor.
SG::JaggedVecElt< Payload_t > Elt_t
One element of the jagged vector.
ConstAccessor(const SG::auxid_t auxid)
Constructor taking an auxid directly.
const Payload_t * getPayloadArray(const AuxVectorData &container) const
Get a pointer to the start of the payload array.
typename std::allocator_traits< ALLOC >::template rebind_alloc< Payload_t > PayloadAlloc_t
Allocator to use for the payload vector.
const_Elt_span getEltSpan(const AuxVectorData &container) const
Get a span over the array of JaggedVecElt objects.
const Elt_t * getEltArray(const AuxVectorData &container) const
Get a pointer to the start of the array of JaggedVecElt objects.
ConstAccessor(const detail::LinkedVarAccessorBase &b)
Constructor.
detail::JaggedVecConstConverter< Payload_t > ConstConverter_t
Converter from JaggedVecElt to a span.
const_reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a const reference.
Describe one element of a jagged vector.
Helper: Make a span from a jagged vector element.
CxxUtils::range_with_conv< typename AuxDataTraits< Payload_t >::const_span > element_type
Base class usable for accessors for variables with linked variables.
range_with_at< std::ranges::transform_view< SPAN, XFORM > > transform_view_with_at
Helper to add at() methods to a transform_view.
Forward declaration.
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition AuxTypes.h:58
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.
Add to a range class conversions to containers.