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-2025 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
112
114 using Base::operator();
115 using Base::getPackedLinkArray;
116 using Base::getDataLinkArray;
117 using Base::getPackedLinkSpan;
118 using Base::getDataLinkSpan;
119 using Base::getDataSpan;
120
121
128 Accessor (const std::string& name);
129
130
138 Accessor (const std::string& name, const std::string& clsname);
139
140
148
149
157 template <IsAuxElement ELT>
158 ELProxy operator() (ELT& e) const;
159
160
172
173
179 void set (AuxElement& e, const Link_t& l) const;
180
181
188 void set (AuxVectorData& container, size_t index, const Link_t& x) const;
189
190
195 PLink_t*
197
198
203 DLink_t*
205
206
213
214
221
222
229 span
231
232
238
239
245};
246
247
248//************************************************************************
249
250
292template <class CONT, class ALLOC, class VALLOC>
293class Accessor<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
294 : public ConstAccessor<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
295{
296public:
297 // Aliases for the types we're dealing with.
301 using VElt_t = std::vector<SG::PackedLink<CONT>, VALLOC>;
303 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
304
308
311
314
315
319 using span =
321
322
325
328
332
333
335 using Base::operator();
336 using Base::getPackedLinkVectorArray;
337 using Base::getDataLinkArray;
338 using Base::getPackedLinkSpan;
339 using Base::getPackedLinkVectorSpan;
340 using Base::getDataSpan;
341 using Base::getDataLinkSpan;
342
343
350 Accessor (const std::string& name);
351
352
360 Accessor (const std::string& name, const std::string& clsname);
361
362
370
371
379 template <IsAuxElement ELT>
380 elt_span operator() (ELT& e) const;
381
382
394
395
401 template <detail::ElementLinkRange<CONT> RANGE>
402 void set (AuxElement& e, const RANGE& r) const;
403
404
411 template <detail::ElementLinkRange<CONT> RANGE>
412 void set (AuxVectorData& container, size_t index, const RANGE& x) const;
413
414
419 VElt_t*
421
422
427 DLink_t*
429
430
437
438
446
447
454
455
462
463
472 span
474
475
481
482
488};
489
490
491} // namespace SG
492
493
495
496
497#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
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
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.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Definition index.py:1
STL namespace.