ATLAS Offline Software
Loading...
Searching...
No Matches
PackedLinkDecorator.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_PACKEDLINKDECORATOR_H
15#define ATHCONTAINERS_PACKEDLINKDECORATOR_H
16
17
29#include "AthLinks/DataLink.h"
31#include <string>
32#include <typeinfo>
33#include <iterator>
34
35
36namespace SG {
37
38
73template <class CONT, class ALLOC>
74class Decorator<PackedLink<CONT>, ALLOC>
76{
77public:
78 // Aliases for the types we're dealing with.
82 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
83
84
90
91
94
95
97 using const_span =
99
100
103
104
109
110
113
116
120
121
128 Decorator (const std::string& name);
129
130
138 Decorator (const std::string& name, const std::string& clsname);
139
140
148
149
161 template <IsConstAuxElement ELT>
162 ELProxy operator() (const ELT& e) const;
163
164
179 ELProxy
181
182
188 template <IsConstAuxElement ELT>
189 void set (const ELT& e, const element_type& l) const;
190
191
198 void set (const AuxVectorData& container, size_t index, const Link_t& x) const;
199
200
205 const PLink_t*
207
208
213 const DLink_t*
215
216
226 PLink_t*
228
229
239 DLink_t*
241
242
249
250
257
258
265
266
277
278
289
290
301 span
303
304
309 template <IsConstAuxElement ELT>
310 bool isAvailableWritable (const ELT& e) const;
311
312
317 bool isAvailableWritable (const AuxVectorData& c) const;
318
319
320protected:
329 Decorator (const std::string& name,
330 const std::string& clsname,
331 const SG::AuxVarFlags flags);
332};
333
334
335//************************************************************************
336
337
383template <class CONT, class ALLOC, class VALLOC>
384class Decorator<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
386{
387public:
388 // Aliases for the types we're dealing with.
391 using VElt_t = std::vector<SG::PackedLink<CONT>, VALLOC>;
393 using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
394
400
404
405
408
413
414
417
418
422 using span =
424
425
428
431
435
436
443 Decorator (const std::string& name);
444
445
453 Decorator (const std::string& name, const std::string& clsname);
454
455
463
464
476 template <IsConstAuxElement ELT>
477 elt_span operator() (const ELT& e) const;
478
479
496
497
503 template <IsConstAuxElement ELT, detail::ElementLinkRange<CONT> RANGE>
504 void set (const ELT& e, const RANGE& x) const;
505
506
513 template <detail::ElementLinkRange<CONT> RANGE>
514 void set (const AuxVectorData& container, size_t index, const RANGE& r) const;
515
516
521 const VElt_t*
523
524
529 const DLink_t*
531
532
538 VElt_t*
540
541
547 DLink_t*
549
550
555 template <IsConstAuxElement ELT>
557 getPackedLinkSpan (const ELT& e) const;
558
559
567
568
576
577
584
585
592
593
600
601
611 template <IsConstAuxElement ELT>
613 getPackedLinkDecorSpan (const ELT& e) const;
614
615
628
629
641
642
653
654
668 span
670
671
676 template <IsConstAuxElement ELT>
677 bool isAvailableWritable (const ELT& e) const;
678
679
684 bool isAvailableWritable (const AuxVectorData& e) const;
685
686
687protected:
696 Decorator (const std::string& name,
697 const std::string& clsname,
698 const SG::AuxVarFlags flags);
699};
700
701
702} // namespace SG
703
704
706
707
708
709#endif // not ATHCONTAINERS_PACKEDLINKDECORATOR_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.
Definition of PackedLink type.
Factory object that creates vectors using AuxTypeVector, specialized for PackedLink.
#define x
Define macros for attributes used to control the static checker.
Allow customizing how aux data types are treated.
CxxUtils::span< container_value_type > span
CxxUtils::span< const container_value_type > const_span
Manage lookup of vectors of auxiliary data.
reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a non-const reference.
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
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.
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.
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.