21 template <StatusCode ( Gaudi::Algorithm::*f )(),
typename C>
22 bool for_algorithms( C& c ) {
23 return std::accumulate( std::begin( c ), std::end( c ),
true,
24 [](
bool b,
Gaudi::Algorithm* a ) {
return ( a->*f )().isSuccess() && b; } );
32 if ( !for_algorithms<&Algorithm::sysInitialize>(
m_subAlgms ) ) {
33 error() <<
"error initializing one or several sub-algorithms of Sequence " <<
name() <<
endmsg;
46 if ( !for_algorithms<&Algorithm::sysFinalize>(
m_subAlgms ) ) {
47 error() <<
"error finalizing one or several sub-algorithms of Sequence " <<
name() <<
endmsg;
60 if ( !for_algorithms<&Algorithm::sysStart>(
m_subAlgms ) ) {
61 error() <<
"error starting one or several sub-algorithms of Sequence " <<
name() <<
endmsg;
70 if ( !for_algorithms<&Algorithm::sysStop>(
m_subAlgms ) ) {
71 error() <<
"error stopping one or several sub-algorithms of Sequence " <<
name() <<
endmsg;
80 if ( !for_algorithms<&Algorithm::sysReinitialize>(
m_subAlgms ) ) {
81 error() <<
"error re-initializing one or several sub-algorithms of Sequence " <<
name() <<
endmsg;
90 if ( !for_algorithms<&Algorithm::sysRestart>(
m_subAlgms ) ) {
91 error() <<
"error re-restarting one or several sub-algorithms of Sequence " <<
name() <<
endmsg;
119 pSubAlgorithm =
dynamic_cast<Algorithm*
>( tmp );
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Base class from which all concrete algorithm classes should be derived.
StatusCode restart() override
the default (empty) implementation of IStateful::restart() method
void acceptDHVisitor(IDataHandleVisitor *) const override
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
const std::string & name() const override
The identifying name of the algorithm object.
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
const std::string & type() const override
The type of the algorithm object.
bool isEnabled() const override
Is this algorithm enabled or disabled?
StatusCode start() override
the default (empty) implementation of IStateful::start() method
StatusCode finalize() override
System finalization.
StatusCode start() override
System start.
StatusCode reinitialize() override
Reinitialization method invoked by the framework.
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
StatusCode createSubAlgorithm(const std::string &type, const std::string &name, Algorithm *&pSubAlg)
Create a sub algorithm.
StatusCode restart() override
Restart method invoked by the framework.
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
void acceptDHVisitor(IDataHandleVisitor *) const override
StatusCode stop() override
System stop.
std::vector< Algorithm * > m_subAlgms
Sub algorithms.
The IAlgorithm is the interface implemented by the Algorithm base class.
virtual void visit(const IDataHandleHolder *)=0
StatusCode initialize() override
Initialization method invoked by the framework.
Small smart pointer class with automatic reference counting for IInterface.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE