ATLAS Offline Software
Loading...
Searching...
No Matches
PackedLinkConstAccessor.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_PACKEDLINKCONSTACCESSOR_H
15#define ATHCONTAINERS_PACKEDLINKCONSTACCESSOR_H
16
17
26#include "AthLinks/ElementLink.h"
27#include "AthLinks/DataLink.h"
30#include <iterator>
31
32
33class IProxyDict;
34
35
36namespace SG {
37
38
69template <class CONT, class ALLOC>
70class ConstAccessor<SG::PackedLink<CONT>, ALLOC>
72{
73public:
74 // Aliases for the types we're dealing with.
78 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
79
80
84
85
88
89
91 using const_span =
94
95
98
101
104
105
112 ConstAccessor (const std::string& name);
113
114
122 ConstAccessor (const std::string& name, const std::string& clsname);
123
124
132
133
138 template <IsConstAuxElement ELT>
139 const Link_t operator() (const ELT& e) const;
140
141
149 const Link_t
151
152
157 const PLink_t*
159
160
165 const DLink_t*
167
168
175
176
183
184
191
192
193protected:
202 ConstAccessor (const std::string& name,
203 const std::string& clsname,
204 const SG::AuxVarFlags flags);
205
206
212 Link_t
213 resolveLink (const AuxVectorData& container, size_t index) const;
214};
215
216
217//************************************************************************
218
219
253template <class CONT, class ALLOC, class VALLOC>
254class ConstAccessor<std::vector<SG::PackedLink<CONT>, VALLOC>, ALLOC>
256{
257public:
258 // Aliases for the types we're dealing with.
261 using VElt_t = std::vector<SG::PackedLink<CONT>, VALLOC>;
263 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
264
268
271
272
276
277
283
284
287
290
293
294
301 ConstAccessor (const std::string& name);
302
303
311 ConstAccessor (const std::string& name, const std::string& clsname);
312
313
321
322
329 template <IsConstAuxElement ELT>
330 const_elt_span operator() (const ELT& e) const;
331
332
344
345
350 const VElt_t*
352
353
358 const DLink_t*
360
361
366 template <IsConstAuxElement ELT>
368 getPackedLinkSpan (const ELT& e) const;
369
370
378
379
386
387
394
395
402
403
404protected:
413 ConstAccessor (const std::string& name,
414 const std::string& clsname,
415 const SG::AuxVarFlags flags);
416};
417
418
419} // namespace SG
420
421
423
424
425#endif // not ATHCONTAINERS_PACKEDLINKCONSTACCESSOR_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.
Base class usable for accessors for variables with linked variables.
Conversions between PackedLink and ElementLink.
Definition of PackedLink type.
Allow customizing how aux data types are treated.
CxxUtils::span< const container_value_type > const_span
Manage lookup of vectors of auxiliary data.
const_reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a const reference.
Base class usable for accessors for variables with linked variables.
Helper: Convert a PackedLink to an ElementLink.
Helper: Convert a vector of PackedLink to a span over ElementLinks.
CxxUtils::range_with_conv< CxxUtils::transform_view_with_at< const_PackedLink_span, detail::PackedLinkConstConverter< CONT > > > value_type
Transform the span of PackedLinks to a span of ElementLinks.
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
STL namespace.
Add at() methods to a range class.
Add to a range class conversions to containers.