ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
EL::AsgToolWrapper Class Referencefinal

an IAlgorithmWrapper for AsgTool More...

#include <AsgToolWrapper.h>

Inheritance diagram for EL::AsgToolWrapper:
Collaboration diagram for EL::AsgToolWrapper:

Public Member Functions

void testInvariant () const
 test the invariant of this object More...
 
 AsgToolWrapper ()
 standard default constructor for serialization More...
 
 AsgToolWrapper (asg::AsgToolConfig val_config)
 standard constructor More...
 
virtual std::string_view getName () const override
 
virtual bool hasName (const std::string &name) const override
 whether this algorithm has the given name More...
 
virtual std::unique_ptr< IAlgorithmWrappermakeClone () const override
 make a clone of this algorithm More...
 
virtual StatusCode initialize (const AlgorithmWorkerData &workerData) override
 call initialize on the algorithm More...
 
virtual StatusCode execute () override
 call execute on the algorithm More...
 
virtual StatusCode finalize () override
 call finalize on the algorithm More...
 
virtual ::StatusCode fileExecute () override
 call fileExecute on the algorithm More...
 
virtual ::StatusCode beginInputFile () override
 call beginInputFile on the algorithm More...
 
virtual ::StatusCode endInputFile () override
 call endInputFile on the algorithm More...
 
virtual AlgorithmgetLegacyAlg ()
 get the legacy algorithm, if we wrap one More...
 
virtual StatusCode postExecute ()
 call postExecute on the algorithm More...
 

Private Attributes

asg::AsgToolConfig m_config
 the algorithm configuration More...
 
ToolHandle< asg::AsgToolm_tool
 the actual tool (once instantiated) More...
 
std::shared_ptr< void > m_cleanup
 the cleanup pointer for this tool More...
 

Detailed Description

an IAlgorithmWrapper for AsgTool

Definition at line 22 of file AsgToolWrapper.h.

Constructor & Destructor Documentation

◆ AsgToolWrapper() [1/2]

EL::AsgToolWrapper::AsgToolWrapper ( )
inline

standard default constructor for serialization

Definition at line 33 of file AsgToolWrapper.h.

33 {};

◆ AsgToolWrapper() [2/2]

EL::AsgToolWrapper::AsgToolWrapper ( asg::AsgToolConfig  val_config)

standard constructor

Definition at line 32 of file AsgToolWrapper.cxx.

34  : m_config (std::move (val_config))
35  {
36  RCU_NEW_INVARIANT (this);
37  }

Member Function Documentation

◆ beginInputFile()

StatusCode EL::AsgToolWrapper::beginInputFile ( )
overridevirtual

call beginInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 110 of file AsgToolWrapper.cxx.

112  {
113  RCU_READ_INVARIANT (this);
114  return StatusCode::SUCCESS;
115  }

◆ endInputFile()

StatusCode EL::AsgToolWrapper::endInputFile ( )
overridevirtual

call endInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 119 of file AsgToolWrapper.cxx.

121  {
122  // no-op
123  return StatusCode::SUCCESS;
124  }

◆ execute()

StatusCode EL::AsgToolWrapper::execute ( )
overridevirtual

call execute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 83 of file AsgToolWrapper.cxx.

85  {
86  RCU_READ_INVARIANT (this);
87  return StatusCode::SUCCESS;
88  }

◆ fileExecute()

StatusCode EL::AsgToolWrapper::fileExecute ( )
overridevirtual

call fileExecute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 101 of file AsgToolWrapper.cxx.

103  {
104  RCU_READ_INVARIANT (this);
105  return StatusCode::SUCCESS;
106  }

◆ finalize()

StatusCode EL::AsgToolWrapper::finalize ( )
overridevirtual

call finalize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 92 of file AsgToolWrapper.cxx.

94  {
95  RCU_READ_INVARIANT (this);
96  return StatusCode::SUCCESS;
97  }

◆ getLegacyAlg()

virtual Algorithm* EL::IAlgorithmWrapper::getLegacyAlg ( )
inlinevirtualinherited

get the legacy algorithm, if we wrap one

Reimplemented in EL::AlgorithmMemoryWrapper, EL::AlgorithmTimerWrapper, and EL::AlgorithmWrapper.

Definition at line 64 of file IAlgorithmWrapper.h.

64 {return nullptr;};

◆ getName()

std::string_view EL::AsgToolWrapper::getName ( ) const
overridevirtual

Inherited Members

Implements EL::IAlgorithmWrapper.

Definition at line 41 of file AsgToolWrapper.cxx.

43  {
44  RCU_READ_INVARIANT (this);
45  return m_config.name();
46  }

◆ hasName()

bool EL::AsgToolWrapper::hasName ( const std::string &  name) const
overridevirtual

whether this algorithm has the given name

Implements EL::IAlgorithmWrapper.

Definition at line 50 of file AsgToolWrapper.cxx.

52  {
53  RCU_READ_INVARIANT (this);
54  return m_config.name() == name;
55  }

◆ initialize()

StatusCode EL::AsgToolWrapper::initialize ( const AlgorithmWorkerData workerData)
overridevirtual

call initialize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 68 of file AsgToolWrapper.cxx.

70  {
71  using namespace msgEventLoop;
72  RCU_CHANGE_INVARIANT (this);
73  if (m_config.makeTool (m_tool, m_cleanup).isFailure())
74  {
75  ANA_MSG_ERROR ("failed to create AsgTool: " << m_config.name());
76  return StatusCode::FAILURE;
77  }
78  return StatusCode::SUCCESS;
79  }

◆ makeClone()

std::unique_ptr< IAlgorithmWrapper > EL::AsgToolWrapper::makeClone ( ) const
overridevirtual

make a clone of this algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 59 of file AsgToolWrapper.cxx.

61  {
62  RCU_READ_INVARIANT (this);
63  return std::make_unique<AsgToolWrapper> (m_config);
64  }

◆ postExecute()

virtual StatusCode EL::IAlgorithmWrapper::postExecute ( )
inlinevirtualinherited

call postExecute on the algorithm

Reimplemented in EL::AlgorithmMemoryWrapper, EL::AlgorithmTimerWrapper, and EL::AlgorithmWrapper.

Definition at line 73 of file IAlgorithmWrapper.h.

73 {return StatusCode::SUCCESS;};

◆ testInvariant()

void EL::AsgToolWrapper::testInvariant ( ) const

test the invariant of this object

Public Members

Definition at line 24 of file AsgToolWrapper.cxx.

26  {
27  RCU_INVARIANT (!m_config.name().empty());
28  }

Member Data Documentation

◆ m_cleanup

std::shared_ptr<void> EL::AsgToolWrapper::m_cleanup
private

the cleanup pointer for this tool

Please note (and do not remove) the comment at the end of the line. This specifically excludes this member from serialization.

Definition at line 83 of file AsgToolWrapper.h.

◆ m_config

asg::AsgToolConfig EL::AsgToolWrapper::m_config
private

the algorithm configuration

Private Members

Definition at line 69 of file AsgToolWrapper.h.

◆ m_tool

ToolHandle<asg::AsgTool> EL::AsgToolWrapper::m_tool
private

the actual tool (once instantiated)

Please note (and do not remove) the comment at the end of the line. This specifically excludes this member from serialization.

Definition at line 76 of file AsgToolWrapper.h.


The documentation for this class was generated from the following files:
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
EL::AsgToolWrapper::m_config
asg::AsgToolConfig m_config
the algorithm configuration
Definition: AsgToolWrapper.h:69
EL::AsgToolWrapper::m_tool
ToolHandle< asg::AsgTool > m_tool
the actual tool (once instantiated)
Definition: AsgToolWrapper.h:76
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EL::AsgToolWrapper::m_cleanup
std::shared_ptr< void > m_cleanup
the cleanup pointer for this tool
Definition: AsgToolWrapper.h:83
RCU_CHANGE_INVARIANT
#define RCU_CHANGE_INVARIANT(x)
Definition: Assert.h:231
asg::AsgComponentConfig::name
const std::string & name() const noexcept
the name of the component
Definition: AsgComponentConfig.cxx:90
asg::AsgToolConfig::makeTool
::StatusCode makeTool(ToolHandle< T > &toolHandle, std::shared_ptr< void > &cleanup, bool allowNestedName=false) const
make a tool with the given configuration
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233