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

an IAlgorithmWrapper for AnaAlgorithm More...

#include <AnaAlgorithmWrapper.h>

Inheritance diagram for EL::AnaAlgorithmWrapper:
Collaboration diagram for EL::AnaAlgorithmWrapper:

Public Member Functions

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

AnaAlgorithmConfig m_config
 the algorithm configuration More...
 
std::unique_ptr< AnaAlgorithmm_algorithm
 the actual algorithm (once instantiated) More...
 

Detailed Description

an IAlgorithmWrapper for AnaAlgorithm

Definition at line 22 of file AnaAlgorithmWrapper.h.

Constructor & Destructor Documentation

◆ AnaAlgorithmWrapper() [1/2]

EL::AnaAlgorithmWrapper::AnaAlgorithmWrapper ( )
inline

standard default constructor for serialization

Definition at line 33 of file AnaAlgorithmWrapper.h.

33 {};

◆ AnaAlgorithmWrapper() [2/2]

EL::AnaAlgorithmWrapper::AnaAlgorithmWrapper ( AnaAlgorithmConfig  val_config)

standard constructor

Definition at line 30 of file AnaAlgorithmWrapper.cxx.

32  : m_config (std::move (val_config))
33  {
34  RCU_NEW_INVARIANT (this);
35  }

Member Function Documentation

◆ beginInputFile()

StatusCode EL::AnaAlgorithmWrapper::beginInputFile ( )
overridevirtual

call beginInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 129 of file AnaAlgorithmWrapper.cxx.

131  {
132  using namespace msgAlgorithmConfig;
133  RCU_READ_INVARIANT (this);
134  if (m_algorithm->hasBeginInputFile())
135  {
136  if (m_algorithm->sysBeginInputFile().isFailure())
137  {
138  ANA_MSG_ERROR ("failed to call beginInputFile() on algorithm: " << m_config.name());
139  return StatusCode::FAILURE;
140  }
141  }
142  return StatusCode::SUCCESS;
143  }

◆ endInputFile()

StatusCode EL::AnaAlgorithmWrapper::endInputFile ( )
overridevirtual

call endInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 147 of file AnaAlgorithmWrapper.cxx.

149  {
150  using namespace msgAlgorithmConfig;
151  RCU_READ_INVARIANT (this);
152  if (m_algorithm->hasEndInputFile())
153  {
154  if (m_algorithm->sysEndInputFile().isFailure())
155  {
156  ANA_MSG_ERROR ("failed to call endInputFile() on algorithm: " << m_config.name());
157  return StatusCode::FAILURE;
158  }
159  }
160  return StatusCode::SUCCESS;
161  }

◆ execute()

StatusCode EL::AnaAlgorithmWrapper::execute ( )
overridevirtual

call execute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 81 of file AnaAlgorithmWrapper.cxx.

83  {
84  using namespace msgAlgorithmConfig;
85  RCU_READ_INVARIANT (this);
86  if (m_algorithm->sysExecute().isFailure())
87  {
88  ANA_MSG_ERROR ("failed to call execute() on algorithm: " << m_config.name());
89  return StatusCode::FAILURE;
90  }
91  return StatusCode::SUCCESS;
92  }

◆ fileExecute()

StatusCode EL::AnaAlgorithmWrapper::fileExecute ( )
overridevirtual

call fileExecute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 111 of file AnaAlgorithmWrapper.cxx.

113  {
114  using namespace msgAlgorithmConfig;
115  RCU_READ_INVARIANT (this);
116  if (m_algorithm->hasFileExecute())
117  {
118  if (m_algorithm->sysFileExecute().isFailure())
119  {
120  ANA_MSG_ERROR ("failed to call fileExecute() on algorithm: " << m_config.name());
121  return StatusCode::FAILURE;
122  }
123  }
124  return StatusCode::SUCCESS;
125  }

◆ finalize()

StatusCode EL::AnaAlgorithmWrapper::finalize ( )
overridevirtual

call finalize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 96 of file AnaAlgorithmWrapper.cxx.

98  {
99  using namespace msgAlgorithmConfig;
100  RCU_READ_INVARIANT (this);
101  if (m_algorithm->sysFinalize().isFailure())
102  {
103  ANA_MSG_ERROR ("failed to call finalize() on algorithm: " << m_config.name());
104  return StatusCode::FAILURE;
105  }
106  return StatusCode::SUCCESS;
107  }

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

Inherited Members

Implements EL::IAlgorithmWrapper.

Definition at line 39 of file AnaAlgorithmWrapper.cxx.

41  {
42  RCU_READ_INVARIANT (this);
43  return m_config.name();
44  }

◆ hasName()

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

whether this algorithm has the given name

Implements EL::IAlgorithmWrapper.

Definition at line 48 of file AnaAlgorithmWrapper.cxx.

50  {
51  RCU_READ_INVARIANT (this);
52  return m_config.name() == name;
53  }

◆ initialize()

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

call initialize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 66 of file AnaAlgorithmWrapper.cxx.

68  {
69  using namespace msgAlgorithmConfig;
70  RCU_CHANGE_INVARIANT (this);
71  if (m_config.makeAlgorithm (m_algorithm, workerData).isFailure())
72  {
73  ANA_MSG_ERROR ("failed to create AnaAlgorithm: " << m_config.name());
74  return StatusCode::FAILURE;
75  }
76  return StatusCode::SUCCESS;
77  }

◆ makeClone()

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

make a clone of this algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 57 of file AnaAlgorithmWrapper.cxx.

59  {
60  RCU_READ_INVARIANT (this);
61  return std::make_unique<AnaAlgorithmWrapper> (m_config);
62  }

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

test the invariant of this object

Public Members

Definition at line 22 of file AnaAlgorithmWrapper.cxx.

24  {
25  RCU_INVARIANT (!m_config.name().empty());
26  }

Member Data Documentation

◆ m_algorithm

std::unique_ptr<AnaAlgorithm> EL::AnaAlgorithmWrapper::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 AnaAlgorithmWrapper.h.

◆ m_config

AnaAlgorithmConfig EL::AnaAlgorithmWrapper::m_config
private

the algorithm configuration

Private Members

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