Go to the documentation of this file.
56 bool managed,
bool checkIfExists ) {
58 if ( checkIfExists ) {
66 if ( ( actualalgtype.
size() > 8 ) && ( actualalgtype.
compare( 0, 8,
"unalias:" ) == 0 ) ) {
67 actualalgtype = actualalgtype.
substr( 8 );
74 this->error() <<
"Algorithm of type " << actualalgtype <<
" is unknown (No factory available)." <<
endmsg;
81 this->error() <<
"More information may be available by setting the global jobOpt \"PluginDebugLevel\" to 1"
87 fatal() <<
"Incompatible interface IAlgorithm version for " << actualalgtype <<
endmsg;
104 if ( !
rc.isSuccess() ) { this->error() <<
"Failed to initialize algorithm: [" << algname <<
"]" <<
endmsg; }
139 for (
auto& it :
m_algs ) {
141 rc = it.algorithm->sysInitialize();
142 if (
rc.isFailure() )
return rc;
149 for (
auto& it :
m_algs ) {
151 rc = it.algorithm->sysStart();
152 if (
rc.isFailure() )
return rc;
159 for (
auto& it :
m_algs ) {
160 if ( !it.managed )
continue;
161 rc = it.algorithm->sysStop();
162 if (
rc.isFailure() )
return rc;
170 while ( it !=
m_algs.end() ) {
173 auto itm =
std::find_if(
range.first,
range.second, [&](
auto const& p ) { return p.second == it->algorithm; } );
176 rc = it->algorithm->sysFinalize();
177 if (
rc.isFailure() )
return rc;
190 for (
auto& it :
m_algs ) {
191 if ( !it.managed )
continue;
192 rc = it.algorithm->sysReinitialize();
193 if (
rc.isFailure() ) {
194 this->error() <<
"Unable to re-initialize algorithm: " << it.algorithm->name() <<
endmsg;
205 fatal() <<
"Error retrieving AlgExecStateSvc" <<
endmsg;
211 for (
auto& it :
m_algs ) {
212 if ( !it.managed )
continue;
213 rc = it.algorithm->sysRestart();
214 m_aess->resetErrorCount( it.algorithm );
215 if (
rc.isFailure() ) {
216 this->error() <<
"Unable to re-initialize algorithm: " << it.algorithm->name() <<
endmsg;
225 for (
auto& algItem :
m_algs ) {
227 if (
alg )
alg->resetMessaging();
Gaudi::StateMachine::State targetFSMState() const override
When we are in the middle of a transition, get the state where the transition is leading us.
AlgTypeAliasesMap m_algTypeAliases
bool existsAlgorithm(std::string_view name) const override
implementation of IAlgManager::existsAlgorithm
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
MSG::Level resetMessaging()
Reinitialize internal states.
T back_inserter(T... args)
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
get
decorate the vector of properties
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
std::vector< IAlgorithm * > m_listOfPtrs
List of pointers to the know services used to implement getAlgorithms()
bool isValid() const
Allow for check if smart pointer is valid.
Helper class to parse a string of format "type/name".
StatusCode createAlgorithm(std::string algtype, std::string algname, IAlgorithm *&algorithm, bool managed=false, bool checkIfExists=true) override
implementation of IAlgManager::createAlgorithm
Base class from which all concrete algorithm classes should be derived.
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).
StatusCode removeAlgorithm(IAlgorithm *alg) override
implementation of IAlgManager::removeAlgorithm
StatusCode start() override
Start (from INITIALIZED to RUNNING).
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
SmartIF< ISvcLocator > & serviceLocator() const override
std::vector< AlgorithmItem > m_algs
algorithms maintained by AlgorithmManager
const std::string & name() const override
Return the name of the manager (implementation of INamedInterface)
SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
StatusCode addAlgorithm(IAlgorithm *alg) override
implementation of IAlgManager::addAlgorithm
constexpr static const auto SUCCESS
std::unordered_multimap< std::string_view, SmartIF< IAlgorithm > > m_algsMap
algorithms maintained by AlgorithmManager
std::string typeName(const std::type_info &typ)
bool isValidInterface(IFace *i)
Templated function that throws an exception if the version if the interface implemented by the object...
AlgorithmManager(IInterface *iface)
default creator
constexpr static const auto FAILURE
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
const std::vector< IAlgorithm * > & getAlgorithms() const override
implementation of IAlgManager::getAlgorithms
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.