Go to the documentation of this file.
55 bool managed,
bool checkIfExists ) {
57 if ( checkIfExists ) {
65 if ( ( actualalgtype.
size() > 8 ) && ( actualalgtype.
compare( 0, 8,
"unalias:" ) == 0 ) ) {
66 actualalgtype = actualalgtype.
substr( 8 );
73 this->error() <<
"Algorithm of type " << actualalgtype <<
" is unknown (No factory available)." <<
endmsg;
80 this->error() <<
"More information may be available by setting the global jobOpt \"PluginDebugLevel\" to 1"
86 fatal() <<
"Incompatible interface IAlgorithm version for " << actualalgtype <<
endmsg;
103 if ( !
rc.isSuccess() ) { this->error() <<
"Failed to initialize algorithm: [" << algname <<
"]" <<
endmsg; }
138 for (
auto& it :
m_algs ) {
140 rc = it.algorithm->sysInitialize();
141 if (
rc.isFailure() )
return rc;
148 for (
auto& it :
m_algs ) {
150 rc = it.algorithm->sysStart();
151 if (
rc.isFailure() )
return rc;
158 for (
auto& it :
m_algs ) {
159 if ( !it.managed )
continue;
160 rc = it.algorithm->sysStop();
161 if (
rc.isFailure() )
return rc;
169 while ( it !=
m_algs.end() ) {
172 auto itm =
std::find_if(
range.first,
range.second, [&](
auto const& p ) { return p.second == it->algorithm; } );
175 rc = it->algorithm->sysFinalize();
176 if (
rc.isFailure() )
return rc;
189 for (
auto& it :
m_algs ) {
190 if ( !it.managed )
continue;
191 rc = it.algorithm->sysReinitialize();
192 if (
rc.isFailure() ) {
193 this->error() <<
"Unable to re-initialize algorithm: " << it.algorithm->name() <<
endmsg;
204 fatal() <<
"Error retrieving AlgExecStateSvc" <<
endmsg;
210 for (
auto& it :
m_algs ) {
211 if ( !it.managed )
continue;
212 rc = it.algorithm->sysRestart();
213 m_aess->resetErrorCount( it.algorithm );
214 if (
rc.isFailure() ) {
215 this->error() <<
"Unable to re-initialize algorithm: " << it.algorithm->name() <<
endmsg;
224 for (
auto& algItem :
m_algs ) {
226 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.