ATLAS Offline Software
Loading...
Searching...
No Matches
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
 AsgToolWrapper ()
 standard default constructor for serialization
 AsgToolWrapper (asg::AsgToolConfig val_config)
 standard constructor
virtual std::string_view getName () const override
virtual bool hasName (const std::string &name) const override
 whether this algorithm has the given name
virtual std::unique_ptr< IAlgorithmWrappermakeClone () const override
 make a clone of this algorithm
virtual StatusCode initialize (const AlgorithmWorkerData &workerData) override
 call initialize on the algorithm
virtual StatusCode execute () override
 call execute on the algorithm
virtual StatusCode finalize () override
 call finalize on the algorithm
virtual::StatusCode fileExecute () override
 call fileExecute on the algorithm
virtual::StatusCode beginInputFile () override
 call beginInputFile on the algorithm
virtual::StatusCode endInputFile () override
 call endInputFile on the algorithm
virtual AlgorithmgetLegacyAlg ()
 get the legacy algorithm, if we wrap one
virtual StatusCode postExecute ()
 call postExecute on the algorithm

Private Attributes

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

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 }
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233
asg::AsgToolConfig m_config
the algorithm configuration

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 }
#define RCU_READ_INVARIANT(x)
Definition Assert.h:229

◆ 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;
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 }
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:231
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
std::shared_ptr< void > m_cleanup
the cleanup pointer for this tool
ToolHandle< asg::AsgTool > m_tool
the actual tool (once instantiated)

◆ 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 }
#define RCU_INVARIANT(x)
Definition Assert.h:201

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: