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

an IAlgorithmWrapper for AnaReentrantAlgorithm More...

#include <AnaReentrantAlgorithmWrapper.h>

Inheritance diagram for EL::AnaReentrantAlgorithmWrapper:
Collaboration diagram for EL::AnaReentrantAlgorithmWrapper:

Public Member Functions

void testInvariant () const
 test the invariant of this object More...
 
 AnaReentrantAlgorithmWrapper ()
 standard default constructor for serialization More...
 
 AnaReentrantAlgorithmWrapper (AnaReentrantAlgorithmConfig 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

AnaReentrantAlgorithmConfig m_config
 the algorithm configuration More...
 
std::unique_ptr< AnaReentrantAlgorithmm_algorithm
 the actual algorithm (once instantiated) More...
 

Detailed Description

an IAlgorithmWrapper for AnaReentrantAlgorithm

Definition at line 22 of file AnaReentrantAlgorithmWrapper.h.

Constructor & Destructor Documentation

◆ AnaReentrantAlgorithmWrapper() [1/2]

EL::AnaReentrantAlgorithmWrapper::AnaReentrantAlgorithmWrapper ( )
inline

standard default constructor for serialization

Definition at line 33 of file AnaReentrantAlgorithmWrapper.h.

33 {};

◆ AnaReentrantAlgorithmWrapper() [2/2]

EL::AnaReentrantAlgorithmWrapper::AnaReentrantAlgorithmWrapper ( AnaReentrantAlgorithmConfig  val_config)

standard constructor

Definition at line 35 of file AnaReentrantAlgorithmWrapper.cxx.

37  : m_config (std::move (val_config))
38  {
39  RCU_NEW_INVARIANT (this);
40  }

Member Function Documentation

◆ beginInputFile()

StatusCode EL::AnaReentrantAlgorithmWrapper::beginInputFile ( )
overridevirtual

call beginInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 125 of file AnaReentrantAlgorithmWrapper.cxx.

127  {
128  // no-op
129  return StatusCode::SUCCESS;
130  }

◆ endInputFile()

StatusCode EL::AnaReentrantAlgorithmWrapper::endInputFile ( )
overridevirtual

call endInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 134 of file AnaReentrantAlgorithmWrapper.cxx.

136  {
137  // no-op
138  return StatusCode::SUCCESS;
139  }

◆ execute()

StatusCode EL::AnaReentrantAlgorithmWrapper::execute ( )
overridevirtual

call execute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 86 of file AnaReentrantAlgorithmWrapper.cxx.

88  {
89  using namespace msgAlgorithmConfig;
90  RCU_READ_INVARIANT (this);
91  if (m_algorithm->sysExecute(Gaudi::Hive::currentContext()).isFailure())
92  {
93  ANA_MSG_ERROR ("failed to call execute() on algorithm: " << m_config.name());
94  return StatusCode::FAILURE;
95  }
96  return StatusCode::SUCCESS;
97  }

◆ fileExecute()

StatusCode EL::AnaReentrantAlgorithmWrapper::fileExecute ( )
overridevirtual

call fileExecute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 116 of file AnaReentrantAlgorithmWrapper.cxx.

118  {
119  // no-op
120  return StatusCode::SUCCESS;
121  }

◆ finalize()

StatusCode EL::AnaReentrantAlgorithmWrapper::finalize ( )
overridevirtual

call finalize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 101 of file AnaReentrantAlgorithmWrapper.cxx.

103  {
104  using namespace msgAlgorithmConfig;
105  RCU_READ_INVARIANT (this);
106  if (m_algorithm->sysFinalize().isFailure())
107  {
108  ANA_MSG_ERROR ("failed to call finalize() on algorithm: " << m_config.name());
109  return StatusCode::FAILURE;
110  }
111  return StatusCode::SUCCESS;
112  }

◆ 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::AnaReentrantAlgorithmWrapper::getName ( ) const
overridevirtual

Inherited Members

Implements EL::IAlgorithmWrapper.

Definition at line 44 of file AnaReentrantAlgorithmWrapper.cxx.

46  {
47  RCU_READ_INVARIANT (this);
48  return m_config.name();
49  }

◆ hasName()

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

whether this algorithm has the given name

Implements EL::IAlgorithmWrapper.

Definition at line 53 of file AnaReentrantAlgorithmWrapper.cxx.

55  {
56  RCU_READ_INVARIANT (this);
57  return m_config.name() == name;
58  }

◆ initialize()

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

call initialize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 71 of file AnaReentrantAlgorithmWrapper.cxx.

73  {
74  using namespace msgAlgorithmConfig;
75  RCU_CHANGE_INVARIANT (this);
76  if (m_config.makeAlgorithm (m_algorithm, workerData).isFailure())
77  {
78  ANA_MSG_ERROR ("failed to create AnaReentrantAlgorithm: " << m_config.name());
79  return StatusCode::FAILURE;
80  }
81  return StatusCode::SUCCESS;
82  }

◆ makeClone()

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

make a clone of this algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 62 of file AnaReentrantAlgorithmWrapper.cxx.

64  {
65  RCU_READ_INVARIANT (this);
66  return std::make_unique<AnaReentrantAlgorithmWrapper> (m_config);
67  }

◆ 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::AnaReentrantAlgorithmWrapper::testInvariant ( ) const

test the invariant of this object

Public Members

Definition at line 27 of file AnaReentrantAlgorithmWrapper.cxx.

29  {
30  RCU_INVARIANT (!m_config.name().empty());
31  }

Member Data Documentation

◆ m_algorithm

std::unique_ptr<AnaReentrantAlgorithm> EL::AnaReentrantAlgorithmWrapper::m_algorithm
private

the actual algorithm (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 AnaReentrantAlgorithmWrapper.h.

◆ m_config

AnaReentrantAlgorithmConfig EL::AnaReentrantAlgorithmWrapper::m_config
private

the algorithm configuration

Private Members

Definition at line 69 of file AnaReentrantAlgorithmWrapper.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::AnaReentrantAlgorithmWrapper::m_config
AnaReentrantAlgorithmConfig m_config
the algorithm configuration
Definition: AnaReentrantAlgorithmWrapper.h:69
EL::AnaReentrantAlgorithmWrapper::m_algorithm
std::unique_ptr< AnaReentrantAlgorithm > m_algorithm
the actual algorithm (once instantiated)
Definition: AnaReentrantAlgorithmWrapper.h:76
EL::AnaReentrantAlgorithmConfig::makeAlgorithm
::StatusCode makeAlgorithm(std::unique_ptr< AnaReentrantAlgorithm > &algorithm, const AlgorithmWorkerData &workerData) const
make an algorithm from this configuration
Definition: AnaReentrantAlgorithmConfig.cxx:50
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233