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

an IAlgorithmWrapper for AsgService More...

#include <AsgServiceWrapper.h>

Inheritance diagram for EL::AsgServiceWrapper:
Collaboration diagram for EL::AsgServiceWrapper:

Public Member Functions

void testInvariant () const
 test the invariant of this object More...
 
 AsgServiceWrapper ()
 standard default constructor for serialization More...
 
 AsgServiceWrapper (asg::AsgServiceConfig 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::AsgServiceConfig m_config
 the algorithm configuration More...
 
std::shared_ptr< asg::AsgServicem_service
 the actual service (once instantiated) More...
 

Detailed Description

an IAlgorithmWrapper for AsgService

Definition at line 22 of file AsgServiceWrapper.h.

Constructor & Destructor Documentation

◆ AsgServiceWrapper() [1/2]

EL::AsgServiceWrapper::AsgServiceWrapper ( )
inline

standard default constructor for serialization

Definition at line 33 of file AsgServiceWrapper.h.

33 {};

◆ AsgServiceWrapper() [2/2]

EL::AsgServiceWrapper::AsgServiceWrapper ( asg::AsgServiceConfig  val_config)

standard constructor

Definition at line 32 of file AsgServiceWrapper.cxx.

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

Member Function Documentation

◆ beginInputFile()

StatusCode EL::AsgServiceWrapper::beginInputFile ( )
overridevirtual

call beginInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 116 of file AsgServiceWrapper.cxx.

118  {
119  RCU_READ_INVARIANT (this);
120  return StatusCode::SUCCESS;
121  }

◆ endInputFile()

StatusCode EL::AsgServiceWrapper::endInputFile ( )
overridevirtual

call endInputFile on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 125 of file AsgServiceWrapper.cxx.

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

◆ execute()

StatusCode EL::AsgServiceWrapper::execute ( )
overridevirtual

call execute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 83 of file AsgServiceWrapper.cxx.

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

◆ fileExecute()

StatusCode EL::AsgServiceWrapper::fileExecute ( )
overridevirtual

call fileExecute on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 107 of file AsgServiceWrapper.cxx.

109  {
110  RCU_READ_INVARIANT (this);
111  return StatusCode::SUCCESS;
112  }

◆ finalize()

StatusCode EL::AsgServiceWrapper::finalize ( )
overridevirtual

call finalize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 92 of file AsgServiceWrapper.cxx.

94  {
95  using namespace msgEventLoop;
96  RCU_READ_INVARIANT (this);
97  if (m_service->finalize().isFailure())
98  {
99  ANA_MSG_ERROR ("failed to call finalize() on service: " << m_config.name());
100  return StatusCode::FAILURE;
101  }
102  return StatusCode::SUCCESS;
103  }

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

Inherited Members

Implements EL::IAlgorithmWrapper.

Definition at line 41 of file AsgServiceWrapper.cxx.

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

◆ hasName()

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

whether this algorithm has the given name

Implements EL::IAlgorithmWrapper.

Definition at line 50 of file AsgServiceWrapper.cxx.

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

◆ initialize()

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

call initialize on the algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 68 of file AsgServiceWrapper.cxx.

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

◆ makeClone()

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

make a clone of this algorithm

Implements EL::IAlgorithmWrapper.

Definition at line 59 of file AsgServiceWrapper.cxx.

61  {
62  RCU_READ_INVARIANT (this);
63  return std::make_unique<AsgServiceWrapper> (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::AsgServiceWrapper::testInvariant ( ) const

test the invariant of this object

Public Members

Definition at line 24 of file AsgServiceWrapper.cxx.

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

Member Data Documentation

◆ m_config

asg::AsgServiceConfig EL::AsgServiceWrapper::m_config
private

the algorithm configuration

Private Members

Definition at line 69 of file AsgServiceWrapper.h.

◆ m_service

std::shared_ptr<asg::AsgService> EL::AsgServiceWrapper::m_service
private

the actual service (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 AsgServiceWrapper.h.


The documentation for this class was generated from the following files:
EL::AsgServiceWrapper::m_config
asg::AsgServiceConfig m_config
the algorithm configuration
Definition: AsgServiceWrapper.h:69
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
EL::AsgServiceWrapper::m_service
std::shared_ptr< asg::AsgService > m_service
the actual service (once instantiated)
Definition: AsgServiceWrapper.h:76
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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::AsgServiceConfig::makeService
::StatusCode makeService(std::shared_ptr< T > &service) const
make a service 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