ATLAS Offline Software
Loading...
Searching...
No Matches
PackedLinkAccessor.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_PACKEDLINKACCESSOR_H
15#define ATHCONTAINERS_PACKEDLINKACCESSOR_H
16
17
27#include <string>
28#include <typeinfo>
29
30
31namespace SG {
32
33
74template <class CONT, class ALLOC>
75class Accessor<PackedLink<CONT>, ALLOC>
76 : public ConstAccessor<PackedLink<CONT>, ALLOC>
77{
78public:
79 // Aliases for the types we're dealing with.
84 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
85
86
90
91
94
95
100
101
104
107
111
115
116
118 using Base::operator();
119 using Base::getPackedLinkArray;
120 using Base::getDataLinkArray;
121 using Base::getPackedLinkSpan;
122 using Base::getDataLinkSpan;
123 using Base::getDataSpan;
124
125
132 Accessor (const std::string& name);
133
134
142 Accessor (const std::string& name, const std::string& clsname);
143
144
152
153
161 template <IsAuxElement ELT>
162 ELProxy operator() (ELT& e) const;
163
164
176
177
183 void set (AuxElement& e, const Link_t& l) const;
184
185
192 void set (AuxVectorData& container, size_t index, const Link_t& x) const;
193
194
199 PLink_t*
201
202
207 DLink_t*
209
210
217
218
225
226
233 span
235
236
242
243
249};
250
251
252//************************************************************************
253
254
296template <class CONT, class ALLOC, class VALLOC>
297class Accessor<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
298 : public ConstAccessor<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
299{
300public:
301 // Aliases for the types we're dealing with.
305 using VElt_t = std::vector<SG::PackedLink<CONT>, VALLOC>;
307 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
308
312
315
318
319
323 using span =
325
326
329
332
336
337
339 using Base::operator();
340 using Base::getPackedLinkVectorArray;
341 using Base::getDataLinkArray;
342 using Base::getPackedLinkSpan;
343 using Base::getPackedLinkVectorSpan;
344 using Base::getDataSpan;
345 using Base::getDataLinkSpan;
346
347
354 Accessor (const std::string& name);
355
356
364 Accessor (const std::string& name, const std::string& clsname);
365
366
374
375
383 template <IsAuxElement ELT>
384 elt_span operator() (ELT& e) const;
385
386
398
399
405 template <detail::ElementLinkRange<CONT> RANGE>
406 void set (AuxElement& e, const RANGE& r) const;
407
408
415 template <detail::ElementLinkRange<CONT> RANGE>
416 void set (AuxVectorData& container, size_t index, const RANGE& x) const;
417
418
423 VElt_t*
425
426
431 DLink_t*
433
434
441
442
450
451
458
459
466
467
476 span
478
479
485
486
492};
493
494
495} // namespace SG
496
497
499
500
501#endif // not ATHCONTAINERS_PACKEDLINKACCESSOR_H
Allow customizing how aux data types are treated.
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.
Helpers for proxying ElementLink for PackedLink accessors.
Flag that a class may have auxiliary data associated with it.
Helper class to provide constant type-safe access to aux data, specialized for PackedLink.
#define x
Define macros for attributes used to control the static checker.
reference_type operator()(ELT &e) const
Fetch the variable for one element, as a non-const reference.
Allow customizing how aux data types are treated.
CxxUtils::span< container_value_type > span
Manage lookup of vectors of auxiliary data.
const_span getDataSpan(const AuxVectorData &container) const
Proxy for ElementLink.
Definition ELProxy.h:126
Converter from a vector of PackedLink to a range of ElementLink proxies.
Definition ELProxy.h:523
Proxy for a span of ElementLinks.
Definition ELProxy.h:331
int r
Definition globals.cxx:22
range_with_at< std::ranges::transform_view< SPAN, XFORM > > transform_view_with_at
Helper to add at() methods to a transform_view.
detail::ELProxyConverter< detail::ELProxyInSpan< CONT > > ELProxyInSpanConverter
Converter producing a proxy — meant to be used when we have a proxy as a member of a span.
Definition ELProxy.h:293
Forward declaration.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
const SG::AuxVectorData * container() const
Return the container holding this element.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Definition index.py:1
STL namespace.