Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  */
14 #ifndef ATHCONTAINERS_PACKEDLINKDECORATOR_H
15 #define ATHCONTAINERS_PACKEDLINKDECORATOR_H
16 
17 
20 #include "AthContainers/Accessor.h"
28 #include "AthLinks/DataLink.h"
30 #include <string>
31 #include <typeinfo>
32 #include <iterator>
33 
34 
35 namespace SG {
36 
37 
72 template <class CONT, class ALLOC>
73 class Decorator<PackedLink<CONT>, ALLOC>
75 {
76 public:
77  // Aliases for the types we're dealing with.
79  using PLink_t = SG::PackedLink<CONT>;
81  using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
82 
83 
89 
90 
93 
94 
96  using const_span =
98 
99 
102 
103 
108 
109 
112 
115 
119 
120 
127  Decorator (const std::string& name);
128 
129 
137  Decorator (const std::string& name, const std::string& clsname);
138 
139 
147 
148 
160  template <IsConstAuxElement ELT>
161  ELProxy operator() (const ELT& e) const;
162 
163 
178  ELProxy
179  operator() (const AuxVectorData& container, size_t index) const;
180 
181 
187  template <IsConstAuxElement ELT>
188  void set (const ELT& e, const element_type& l) const;
189 
190 
197  void set (const AuxVectorData& container, size_t index, const Link_t& x) const;
198 
199 
204  const PLink_t*
205  getPackedLinkArray (const AuxVectorData& container) const;
206 
207 
212  const DLink_t*
213  getDataLinkArray (const AuxVectorData& container) const;
214 
215 
225  PLink_t*
226  getPackedLinkDecorArray (const AuxVectorData& container) const;
227 
228 
238  DLink_t*
239  getDataLinkDecorArray (const AuxVectorData& container) const;
240 
241 
247  getPackedLinkSpan (const AuxVectorData& container) const;
248 
249 
255  getDataLinkSpan (const AuxVectorData& container) const;
256 
257 
262  const_span
263  getDataSpan (const AuxVectorData& container) const;
264 
265 
275  getPackedLinkDecorSpan (const AuxVectorData& container) const;
276 
277 
287  getDataLinkDecorSpan (const AuxVectorData& container) const;
288 
289 
300  span
301  getDecorationSpan (const AuxVectorData& container) const;
302 
303 
308  template <IsConstAuxElement ELT>
309  bool isAvailableWritable (const ELT& e) const;
310 
311 
316  bool isAvailableWritable (const AuxVectorData& c) const;
317 
318 
319 protected:
328  Decorator (const std::string& name,
329  const std::string& clsname,
330  const SG::AuxVarFlags flags);
331 };
332 
333 
334 //************************************************************************
335 
336 
382 template <class CONT, class ALLOC, class VALLOC>
383 class Decorator<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
385 {
386 public:
387  // Aliases for the types we're dealing with.
389  using PLink_t = SG::PackedLink<CONT>;
390  using VElt_t = std::vector<SG::PackedLink<CONT>, VALLOC>;
392  using DLinkAlloc_t = typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
393 
399 
403 
404 
407 
410  using const_span =
412 
413 
416 
417 
421  using span =
423 
424 
427 
430 
434 
435 
442  Decorator (const std::string& name);
443 
444 
452  Decorator (const std::string& name, const std::string& clsname);
453 
454 
462 
463 
475  template <IsConstAuxElement ELT>
476  elt_span operator() (const ELT& e) const;
477 
478 
493  elt_span
494  operator() (const AuxVectorData& container, size_t index) const;
495 
496 
502  template <IsConstAuxElement ELT, detail::ElementLinkRange<CONT> RANGE>
503  void set (const ELT& e, const RANGE& x) const;
504 
505 
512  template <detail::ElementLinkRange<CONT> RANGE>
513  void set (const AuxVectorData& container, size_t index, const RANGE& r) const;
514 
515 
520  const VElt_t*
521  getPackedLinkVectorArray (const AuxVectorData& container) const;
522 
523 
528  const DLink_t*
529  getDataLinkArray (const AuxVectorData& container) const;
530 
531 
537  VElt_t*
539 
540 
546  DLink_t*
547  getDataLinkDecorArray (const AuxVectorData& container) const;
548 
549 
554  template <IsConstAuxElement ELT>
556  getPackedLinkSpan (const ELT& e) const;
557 
558 
565  getPackedLinkSpan (const AuxVectorData& container, size_t index) const;
566 
567 
574  getPackedLinkSpan (AuxVectorData& container, size_t index) const;
575 
576 
582  getPackedLinkVectorSpan (const AuxVectorData& container) const;
583 
584 
590  getDataLinkSpan (const AuxVectorData& container) const;
591 
592 
597  const_span
598  getDataSpan (const AuxVectorData& container) const;
599 
600 
610  template <IsConstAuxElement ELT>
612  getPackedLinkDecorSpan (const ELT& e) const;
613 
614 
626  getPackedLinkDecorSpan (const AuxVectorData& container, size_t index) const;
627 
628 
639  getPackedLinkVectorDecorSpan (const AuxVectorData& container) const;
640 
641 
651  getDataLinkDecorSpan (const AuxVectorData& container) const;
652 
653 
667  span
668  getDecorationSpan (const AuxVectorData& container) const;
669 
670 
675  template <IsConstAuxElement ELT>
676  bool isAvailableWritable (const ELT& e) const;
677 
678 
683  bool isAvailableWritable (const AuxVectorData& e) const;
684 
685 
686 protected:
695  Decorator (const std::string& name,
696  const std::string& clsname,
697  const SG::AuxVarFlags flags);
698 };
699 
700 
701 } // namespace SG
702 
703 
705 
706 
707 
708 #endif // not ATHCONTAINERS_PACKEDLINKDECORATOR_H
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SG::detail::LinkedVarAccessorBase
Base class usable for accessors for variables with linked variables.
Definition: LinkedVarAccessorBase.h:29
beamspotman.r
def r
Definition: beamspotman.py:676
SG::detail::ELProxyT
Proxy for ElementLink.
Definition: ELProxy.h:126
ELProxy.h
Helpers for proxying ElementLink for PackedLink accessors.
SG::detail::PackedLinkVectorConstConverter
Helper: Convert a vector of PackedLink to a span over ElementLinks.
Definition: PackedLinkConversions.h:75
AuxElementConcepts.h
SG::detail::PackedLinkConstConverter
Helper: Convert a PackedLink to an ElementLink.
Definition: PackedLinkConversions.h:37
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IAuxElement.h
Flag that a class may have auxiliary data associated with it.
index
Definition: index.py:1
SG::detail::ELProxyConverter
Extend PackedLinkConverter with a (non-const) conversion from PackedLink to a proxy object.
Definition: ELProxy.h:246
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
taskman.template
dictionary template
Definition: taskman.py:317
SG::Decorator::span
typename AuxDataTraits< T, ALLOC >::span span
A span over elements in the container.
Definition: Decorator.h:74
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
SG::Decorator::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
x
#define x
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:61
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::Decorator::operator()
reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a non-const reference.
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
SG::detail::ELSpanConverter
Converter from a vector of PackedLink to a range of ElementLink proxies.
Definition: ELProxy.h:523
SG::AuxDataTraits
Allow customizing how aux data types are treated.
Definition: AuxDataTraits.h:40
vector
Definition: MultiHisto.h:13
SG::detail::ELSpanProxy
Proxy for a span of ElementLinks.
Definition: ELProxy.h:331
AuxDataTraits.h
Allow customizing how aux data types are treated.
SG::AuxVarFlags
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypes.h:58
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
PackedLinkDecorator.icc
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Accessor.h
Helper class to provide type-safe access to aux data.
AuxTypes.h
Basic definitions for auxiliary types.
CxxUtils::range_with_at
Add at() methods to a range class.
Definition: range_with_at.h:33
SG::Decorator::const_span
typename AuxDataTraits< T, ALLOC >::const_span const_span
Definition: Decorator.h:75
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
PackedLinkConstAccessor.h
Helper class to provide constant type-safe access to aux data, specialized for PackedLink.
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
SG::detail::PackedLink_span
typename AuxDataTraits< PackedLink< CONT >, PLINK_ALLOC >::span PackedLink_span
A span over PackedLink.
Definition: ELProxy.h:302
checker_macros.h
Define macros for attributes used to control the static checker.
python.compressB64.c
def c
Definition: compressB64.py:93