14#ifndef ATHCONTAINERS_PACKEDLINKDECORATOR_H
15#define ATHCONTAINERS_PACKEDLINKDECORATOR_H
29#include "AthLinks/DataLink.h"
74template <
class CONT,
class ALLOC>
80 using Link_t = ElementLink<CONT>;
81 using PLink_t = SG::PackedLink<CONT>;
82 using DLink_t = DataLink<CONT>;
83 using DLinkAlloc_t =
typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
87 using const_PackedLink_span =
typename AuxDataTraits<PackedLink<CONT>, ALLOC>
::const_span;
88 using const_DataLink_span =
typename AuxDataTraits<DataLink<CONT>, DLinkAlloc_t>
::const_span;
90 using DataLink_span =
typename AuxDataTraits<DataLink<CONT>, DLinkAlloc_t>
::span;
94 using ConstConverter_t = detail::PackedLinkConstConverter<CONT>;
98 using const_span = std::ranges::transform_view<const_PackedLink_span,
103 using ELProxy = detail::ELProxyT<detail::ELProxyValBase<CONT> >;
123 using rhs_const_reference_type =
const Link_t&;
146 Decorator (
const std::string& name,
const std::string& clsname);
169 template <IsConstAuxElement ELT>
196 template <IsConstAuxElement ELT>
255 const_PackedLink_span
317 template <IsConstAuxElement ELT>
338 const std::string& clsname,
391template <
class CONT,
class ALLOC,
class VALLOC>
392class Decorator<
std::
vector<PackedLink<CONT>, VALLOC>, ALLOC>
393 :
public detail::LinkedVarAccessorBase
399 using VElt_t = std::vector<SG::PackedLink<CONT>, VALLOC>;
401 using DLinkAlloc_t =
typename std::allocator_traits<ALLOC>::template rebind_alloc<DLink_t>;
405 using const_DataLink_span =
typename AuxDataTraits<DataLink<CONT>, DLinkAlloc_t>
::const_span;
407 using DataLink_span =
typename AuxDataTraits<DataLink<CONT>, DLinkAlloc_t>
::span;
410 using const_PackedLink_span =
typename AuxDataTraits<PackedLink<CONT>, VALLOC>
::const_span;
411 using PackedLink_span =
typename AuxDataTraits<PackedLink<CONT>, VALLOC>
::span;
415 using ConstVectorTransform_t = detail::PackedLinkVectorConstConverter<CONT>;
419 using const_span = std::ranges::transform_view<const_PackedLinkVector_span,
420 ConstVectorTransform_t>;
430 using span = std::ranges::transform_view<PackedLinkVector_span,
461 Decorator (
const std::string& name,
const std::string& clsname);
484 template <IsConstAuxElement ELT>
511 template <IsConstAuxElement ELT, detail::ElementLinkRange<CONT> RANGE>
512 void set (
const ELT& e,
const RANGE&
x)
const;
521 template <detail::ElementLinkRange<CONT> RANGE>
563 template <IsConstAuxElement ELT>
564 const_PackedLink_span
573 const_PackedLink_span
590 const_PackedLinkVector_span
619 template <IsConstAuxElement ELT>
647 PackedLinkVector_span
684 template <IsConstAuxElement ELT>
705 const std::string& clsname,
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.
ElementLink< xAOD::TruthParticleContainer > Link_t
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 macros for attributes used to control the static checker.
Object reference supporting deferred reading from StoreGate.
ElementLink implementation for ROOT usage.
CxxUtils::span< container_value_type > span
CxxUtils::span< const container_value_type > const_span
Manage lookup of vectors of auxiliary data.
Converter from a vector of PackedLink to a range of ElementLink proxies.
Proxy for a span of ElementLinks.
Base class usable for accessors for variables with linked variables.
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.
typename AuxDataTraits< PackedLink< CONT >, PLINK_ALLOC >::span PackedLink_span
A span over PackedLink.
detail::ELSpanConverter< CONT, VALLOC > ELSpanConverter
Transform a span over vector of PackedLink to a span over span over ElementLink proxies.
AuxVarFlags
Additional flags to qualify an auxiliary variable.
PackedLink_span getPackedLinkDecorSpan(const AuxVectorData &container) const
Get a span over the array of PackedLinks, as a decoration.
std::ranges::transform_view< const_PackedLinkVector_span, ConstVectorTransform_t > const_span
Helper class to provide constant type-safe access to aux data, specialized for a vector of PackedLink...
DataLink_span getDataLinkDecorSpan(const AuxVectorData &container) const
Get a span over the array of DataLinks, as a decoration.
const_PackedLinkVector_span getPackedLinkVectorSpan(const AuxVectorData &container) const
Get a span over the vectors of PackedLinks.
detail::ELSpanProxy< CONT, VALLOC > elt_span
Presents a vector of PackedLink as a range of ElementLink proxies.
std::ranges::transform_view< PackedLinkVector_span, ELSpanConverter > span
const_PackedLink_span getPackedLinkSpan(const AuxVectorData &container) const
Get a span over the array of PackedLinks.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
SG::auxid_t auxid() const
Return the aux id for this variable.
const PLink_t * getPackedLinkArray(const AuxVectorData &container) const
Get a pointer to the start of the array of PackedLinks.
void set(const ELT &e, const element_type &x) const
Set the variable for one element.
const_DataLink_span getDataLinkSpan(const AuxVectorData &container) const
Get a span over the array of DataLinks.
reference_type operator()(const ELT &e) const
Fetch the variable for one element, as a non-const reference.
PackedLinkVector_span getPackedLinkVectorDecorSpan(const AuxVectorData &container) const
Get a span over the vectors of PackedLinks, as a decoration.
void const_container_pointer_type
DLink_t * getDataLinkDecorArray(const AuxVectorData &container) const
Get a pointer to the start of the linked array of DataLinks, as a decoration.
elt_span reference_type
Type referencing an item.
const SG::AuxVectorData * container() const
Return the container holding this element.
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable(const std::string &name, const std::string &clsname="")
Check if an aux variable is available for writing.
VElt_t * getPackedLinkVectorDecorArray(const AuxVectorData &container) const
Get a pointer to the start of the array of vectors of PackedLinks, as a decoration.
PLink_t * getPackedLinkDecorArray(const AuxVectorData &container) const
Get a pointer to the start of the array of PackedLinks, as a decoration.
const_span getDataSpan(const AuxVectorData &container) const
Get a span over the auxiliary data array.
elt_span element_type
Type the user sees.
const DLink_t * getDataLinkArray(const AuxVectorData &container) const
Get a pointer to the start of the linked array of DataLinks.
const VElt_t * getPackedLinkVectorArray(const AuxVectorData &container) const
Get a pointer to the start of the array of vectors of PackedLinks.
span getDecorationSpan(const AuxVectorData &container) const
Get a span over the auxiliary data array.
void container_pointer_type
Not supported.
size_t auxid_t
Identifier for a particular aux data item.
A packed version of ElementLink.