ATLAS Offline Software
Loading...
Searching...
No Matches
SG::detail Namespace Reference

Classes

class  AuxDataConstSpan
 Auxiliary variable span wrapper (const). More...
class  AuxDataSpan
 Auxiliary variable span wrapper. More...
class  DataVectorAllocDummy
class  ELProxyConverter
 Extend PackedLinkConverter with a (non-const) conversion from PackedLink to a proxy object. More...
class  ELProxyRefBase
 Base class for ELProxyT, with the converter held by reference. More...
class  ELProxyT
 Proxy for ElementLink. More...
class  ELProxyValBase
 Base class for ELProxyT, with the converter held by value. More...
class  ELSpanConverter
 Converter from a vector of PackedLink to a range of ElementLink proxies. More...
class  ELSpanProxy
 Proxy for a span of ElementLinks. More...
class  IteratorBase
 Implementation class, not to be used directly Iterates over valid proxies it the range. More...
class  JaggedVecConstConverter
 Helper: Make a span from a jagged vector element. More...
class  JaggedVecConverter
 Helper: Make a span — either read-only or writable — from a jagged vector element. More...
class  JaggedVecProxyBase
 Base class for jagged vector proxies. More...
class  JaggedVecProxyRefBase
 Adapter for holding the proxy base information by reference. More...
class  JaggedVecProxyT
 Proxy for jagged vectors. More...
class  JaggedVecProxyValBase
 Adapter for holding the proxy base information by value. More...
class  LinkedVarAccessorBase
 Base class usable for accessors for variables with linked variables. More...
class  PackedLinkConstConverter
 Helper: Convert a PackedLink to an ElementLink. More...
class  PackedLinkConverter
 Helper: Convert a PackedLink to an ElementLink and vice-versa. More...
class  PackedLinkVectorConstConverter
 Helper: Convert a vector of PackedLink to a span over ElementLinks. More...
class  PackedLinkVectorHelper
 Helper functions for managing PackedLink variables. More...
class  PackedLinkVectorHelperBase
 Helper functions for managing PackedLink variables. More...
class  WDHScan
 Helper to scan a tree of components to search for another handle key potentially conflicting with the container key part of a WriteDecorHandleKey. More...

Concepts

concept  ElementLinkRange
 Concept for a range of things that can convert to ElementLink<CONT>.

Typedefs

template<class CONT>
using ELProxyInSpan = detail::ELProxyT<detail::ELProxyRefBase<CONT> >
 Proxy holding the converter by reference — meant to be used when we have a proxy as a member of a span.
template<class CONT>
using ELProxyInSpanConverter
 Converter producing a proxy — meant to be used when we have a proxy as a member of a span.
template<class CONT, class PLINK_ALLOC>
using PackedLink_span = typename AuxDataTraits<PackedLink<CONT>, PLINK_ALLOC>::span
 A span over PackedLink.
template<class CONT, class PLINK_ALLOC>
using ELSpanProxyBase
 A range transforming a span over PackedLink to ElementLink proxies.

Functions

bool handleInHolder (const DataObjID &contHandleKey, const IDataHandleHolder &holder)
 Test to see if HOLDER has registered a handle key matching CONTHANDLEKEY, as either input or output.
const IDataHandleHolder * findParent (const IDataHandleHolder *h)
 Find the top-level Gaudi component for H.
void registerWriteDecorHandleKey (IDataHandleHolder *owner, const DataObjID &contHandleKey)
 Optionally register read dependency of a WriteDecorHandleKey.

Typedef Documentation

◆ ELProxyInSpan

Proxy holding the converter by reference — meant to be used when we have a proxy as a member of a span.

Definition at line 287 of file ELProxy.h.

◆ ELProxyInSpanConverter

template<class CONT>
using SG::detail::ELProxyInSpanConverter
Initial value:
Extend PackedLinkConverter with a (non-const) conversion from PackedLink to a proxy object.
Definition ELProxy.h:246

Converter producing a proxy — meant to be used when we have a proxy as a member of a span.

Definition at line 293 of file ELProxy.h.

◆ ELSpanProxyBase

template<class CONT, class PLINK_ALLOC>
using SG::detail::ELSpanProxyBase
Initial value:
std::reference_wrapper<detail::ELProxyInSpanConverter<CONT> > >
range_with_at< std::ranges::transform_view< SPAN, XFORM > > transform_view_with_at
Helper to add at() methods to a transform_view.

A range transforming a span over PackedLink to ElementLink proxies.

Definition at line 307 of file ELProxy.h.

◆ PackedLink_span

template<class CONT, class PLINK_ALLOC>
using SG::detail::PackedLink_span = typename AuxDataTraits<PackedLink<CONT>, PLINK_ALLOC>::span

A span over PackedLink.

Definition at line 302 of file ELProxy.h.

Function Documentation

◆ findParent()

const IDataHandleHolder * SG::detail::findParent ( const IDataHandleHolder * h)

Find the top-level Gaudi component for H.

Parameters
HThe component at which to start the search.

We're given a Gaudi component H as an IDataHandleHolder. If this is an algorithm, return it. Otherwise, search up the list of parents to find either the owning algorithm or a top-level public tool or service.

Definition at line 58 of file WriteDecorHandleKey.cxx.

59{
60 while (true) {
61 const IAlgTool* astool = dynamic_cast<const IAlgTool*> (h);
62 if (!astool) return h;
63 const IInterface* parent = astool->parent();
64 if (!parent) return h;
65 auto pdh = dynamic_cast<const IDataHandleHolder*> (parent);
66 if (!pdh) return h;
67 if (dynamic_cast<const Gaudi::Algorithm*> (parent)) return pdh;
68 h = pdh;
69 }
70}
Header file for AthHistogramAlgorithm.

◆ handleInHolder()

bool SG::detail::handleInHolder ( const DataObjID & contHandleKey,
const IDataHandleHolder & holder )

Test to see if HOLDER has registered a handle key matching CONTHANDLEKEY, as either input or output.

Parameters
contHandleKeyThe handle key to test.
holderThe component to search.

Definition at line 30 of file WriteDecorHandleKey.cxx.

32{
33 for (const Gaudi::DataHandle* h : holder.inputHandles()) {
34 if (h->fullKey() == contHandleKey) {
35 return true;
36 }
37 }
38
39 for (const Gaudi::DataHandle* h : holder.outputHandles()) {
40 if (h->fullKey() == contHandleKey) {
41 return true;
42 }
43 }
44
45 return false;
46}

◆ registerWriteDecorHandleKey()

void SG::detail::registerWriteDecorHandleKey ( IDataHandleHolder * owner,
const DataObjID & contHandleKey )

Optionally register read dependency of a WriteDecorHandleKey.

A WriteDecorHandle logically has a read dependency on the container itself. However, just declaring this as a usual ReadHandleKey will cause problems if used in an algorithm that also creates the container: we'll get complaints from the Algorithm base class about circular dependencies.

To deal with this, we don't declare the container ReadHandleKey in declareProperty. Instead, we wait until initialize and declare the dependency with addDependency only if it is not already on a handle list.

This issue also comes up across multiple tools in a single algorithm. For example, if an algorithm that has one tool that creates an container and another tool with a WriteDecorHandleKey, we can get a warning about a circular dependency. To suppress this for the common case, we also search the component tree under the algorithm and avoid adding the ReadHandleKey if there's a matching component in the tree before the one owning the WriteDecorHandleKey. (We only do it for components earlier in the tree walk to make it less likely that we'll suppress the warning for a genuine use-before-write misconfiguration.)

Definition at line 154 of file WriteDecorHandleKey.cxx.

156{
157 if (!owner) return;
158
159 // Does this component already have a key matching @c contHandleKey?
160 bool found = handleInHolder (contHandleKey, *owner);
161
162 if (!found) {
163 // No --- now search the complete component tree up to @c owner for a match.
164 const IDataHandleHolder* parent = findParent (owner);
165 if (parent && parent != owner) {
166 WDHScan scan (contHandleKey, owner);
167 parent->acceptDHVisitor (&scan);
168 found = scan.m_found;
169 }
170 }
171
172 if (!found) {
173 owner->addDependency (contHandleKey, Gaudi::DataHandle::Reader);
174 }
175}
Helper to scan a tree of components to search for another handle key potentially conflicting with the...
void scan(TDirectory *td=0, int depth=0)
Definition listroot.cxx:440
const IDataHandleHolder * findParent(const IDataHandleHolder *h)
Find the top-level Gaudi component for H.
bool handleInHolder(const DataObjID &contHandleKey, const IDataHandleHolder &holder)
Test to see if HOLDER has registered a handle key matching CONTHANDLEKEY, as either input or output.