|
Gaudi Framework, version v21r11 |
| Home | Generated: 30 Sep 2010 |
#include <MinimalEventLoopMgr.h>
Public Types | |
| typedef std::list< SmartIF < IAlgorithm > > | ListAlg |
| Creator friend class. | |
| typedef std::list< IAlgorithm * > | ListAlgPtrs |
| typedef std::list< std::string > | ListName |
| typedef std::vector< std::string > | VectorName |
Public Member Functions | |
| MinimalEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc) | |
| Standard Constructor. | |
| virtual | ~MinimalEventLoopMgr () |
| Standard Destructor. | |
| virtual StatusCode | initialize () |
| implementation of IService::initialize | |
| virtual StatusCode | start () |
| implementation of IService::start | |
| virtual StatusCode | stop () |
| implementation of IService::stop | |
| virtual StatusCode | finalize () |
| implementation of IService::finalize | |
| virtual StatusCode | reinitialize () |
| implementation of IService::reinitialize | |
| virtual StatusCode | restart () |
| implementation of IService::restart | |
| virtual StatusCode | nextEvent (int maxevt) |
| implementation of IEventProcessor::nextEvent | |
| virtual StatusCode | executeEvent (void *par) |
| implementation of IEventProcessor::executeEvent(void* par) | |
| virtual StatusCode | executeRun (int maxevt) |
| implementation of IEventProcessor::executeRun( ) | |
| virtual StatusCode | stopRun () |
| implementation of IEventProcessor::stopRun( ) | |
| void | topAlgHandler (Property &p) |
| Top algorithm List handler. | |
| StatusCode | decodeTopAlgs () |
| decodeTopAlgNameList & topAlgNameListHandler | |
| void | outStreamHandler (Property &p) |
| Output stream List handler. | |
| StatusCode | decodeOutStreams () |
| decodeOutStreamNameList & outStreamNameListHandler | |
Protected Types | |
| enum | State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED } |
Protected Attributes | |
| SmartIF< IAppMgrUI > | m_appMgrUI |
| Reference to the IAppMgrUI interface of the application manager. | |
| SmartIF< IIncidentSvc > | m_incidentSvc |
| Reference to the incident service. | |
| ListAlg | m_topAlgList |
| List of top level algorithms. | |
| ListAlg | m_outStreamList |
| List of output streams. | |
| std::string | m_outStreamType |
| Out Stream type. | |
| StringArrayProperty | m_topAlgNames |
| List of top level algorithms names. | |
| StringArrayProperty | m_outStreamNames |
| List of output stream names. | |
| State | m_state |
| State of the object. | |
| bool | m_scheduledStop |
| Scheduled stop of event processing. | |
| SmartIF< IIncidentListener > | m_abortEventListener |
| Instance of the incident listener waiting for AbortEvent. | |
| bool | m_abortEvent |
| Flag signalling that the event being processedhas to be aborted (skip all following top algs). | |
| std::string | m_abortEventSource |
| Source of the AbortEvent incident. | |
Private Member Functions | |
| MinimalEventLoopMgr (const MinimalEventLoopMgr &) | |
| Fake copy constructor (never implemented). | |
| MinimalEventLoopMgr & | operator= (const MinimalEventLoopMgr &) |
| Fake assignment operator (never implemented). | |
This object handles the minimal requirements needed by the application manager. It also is capable of handling a bunch of algorithms and output streams. However, they list may as well be empty.
Definition at line 26 of file MinimalEventLoopMgr.h.
| typedef std::list<SmartIF<IAlgorithm> > MinimalEventLoopMgr::ListAlg |
Definition at line 31 of file MinimalEventLoopMgr.h.
Definition at line 32 of file MinimalEventLoopMgr.h.
Definition at line 33 of file MinimalEventLoopMgr.h.
enum MinimalEventLoopMgr::State [protected] |
Definition at line 37 of file MinimalEventLoopMgr.h.
00037 { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
| MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const std::string & | nam, | |
| ISvcLocator * | svcLoc | |||
| ) |
Standard Constructor.
Definition at line 45 of file MinimalEventLoopMgr.cpp.
00046 : base_class(nam, svcLoc), m_appMgrUI(svcLoc) 00047 { 00048 declareProperty("TopAlg", m_topAlgNames ); 00049 declareProperty("OutStream", m_outStreamNames ); 00050 declareProperty("OutStreamType", m_outStreamType = "OutputStream"); 00051 m_topAlgNames.declareUpdateHandler ( &MinimalEventLoopMgr::topAlgHandler, this ); 00052 m_outStreamNames.declareUpdateHandler( &MinimalEventLoopMgr::outStreamHandler, this ); 00053 m_state = OFFLINE; 00054 m_scheduledStop = false; 00055 m_abortEvent = false; 00056 }
| MinimalEventLoopMgr::~MinimalEventLoopMgr | ( | ) | [virtual] |
| MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const MinimalEventLoopMgr & | ) | [private] |
Fake copy constructor (never implemented).
| StatusCode MinimalEventLoopMgr::initialize | ( | ) | [virtual] |
implementation of IService::initialize
Reimplemented from Service.
Reimplemented in EventLoopMgr.
Definition at line 68 of file MinimalEventLoopMgr.cpp.
00068 { 00069 00070 MsgStream log(msgSvc(), name()); 00071 00072 if ( !m_appMgrUI.isValid() ) { 00073 return StatusCode::FAILURE; 00074 } 00075 00076 StatusCode sc = Service::initialize(); 00077 if ( !sc.isSuccess() ) { 00078 log << MSG::ERROR << "Failed to initialize Service Base class." << endmsg; 00079 return StatusCode::FAILURE; 00080 } 00081 00082 SmartIF<IProperty> prpMgr(serviceLocator()); 00083 if ( ! prpMgr.isValid() ) { 00084 log << MSG::ERROR << "Error retrieving AppMgr interface IProperty." << endmsg; 00085 return StatusCode::FAILURE; 00086 } 00087 else { 00088 if ( m_topAlgNames.value().size() == 0 ) { 00089 setProperty(prpMgr->getProperty("TopAlg")).ignore(); 00090 } 00091 if ( m_outStreamNames.value().size() == 0 ) { 00092 setProperty(prpMgr->getProperty("OutStream")).ignore(); 00093 } 00094 } 00095 00096 // Get the references to the services that are needed by the ApplicationMgr itself 00097 m_incidentSvc = serviceLocator()->service("IncidentSvc"); 00098 if( !m_incidentSvc.isValid() ) { 00099 log << MSG::FATAL << "Error retrieving IncidentSvc." << endmsg; 00100 return StatusCode::FAILURE; 00101 } 00102 00103 m_abortEventListener = new AbortEventListener(m_abortEvent,m_abortEventSource); 00104 m_incidentSvc->addListener(m_abortEventListener,IncidentType::AbortEvent); 00105 00106 // The state is changed at this moment to allow decodeXXXX() to do something 00107 m_state = INITIALIZED; 00108 00109 //-------------------------------------------------------------------------------------------- 00110 // Create output streams. Do not initialize them yet. 00111 // The state is updated temporarily in order to enable the handler, which 00112 // is also triggered by a change to the "OutputStream" Property. 00113 //-------------------------------------------------------------------------------------------- 00114 sc = decodeOutStreams(); 00115 if ( !sc.isSuccess() ) { 00116 log << MSG::ERROR << "Failed to initialize Output streams." << endmsg; 00117 m_state = CONFIGURED; 00118 return sc; 00119 } 00120 //-------------------------------------------------------------------------------------------- 00121 // Create all needed Top Algorithms. Do not initialize them yet. 00122 // The state is updated temporarily in order to enable the handler, which 00123 // is also triggered by a change to the "TopAlg" Property. 00124 //-------------------------------------------------------------------------------------------- 00125 sc = decodeTopAlgs(); 00126 if ( !sc.isSuccess() ) { 00127 log << MSG::ERROR << "Failed to initialize Top Algorithms streams." << endmsg; 00128 m_state = CONFIGURED; 00129 return sc; 00130 } 00131 00132 ListAlg::iterator ita; 00133 // Initialize all the new TopAlgs. In fact Algorithms are protected against getting 00134 // initialized twice. 00135 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00136 sc = (*ita)->sysInitialize(); 00137 if( !sc.isSuccess() ) { 00138 log << MSG::ERROR << "Unable to initialize Algorithm: " << (*ita)->name() << endmsg; 00139 return sc; 00140 } 00141 } 00142 for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00143 sc = (*ita)->sysInitialize(); 00144 if( !sc.isSuccess() ) { 00145 log << MSG::ERROR << "Unable to initialize Output Stream: " << (*ita)->name() << endmsg; 00146 return sc; 00147 } 00148 } 00149 00150 return StatusCode::SUCCESS; 00151 }
| StatusCode MinimalEventLoopMgr::start | ( | ) | [virtual] |
implementation of IService::start
Reimplemented from Service.
Definition at line 155 of file MinimalEventLoopMgr.cpp.
00155 { 00156 00157 StatusCode sc = Service::start(); 00158 if ( ! sc.isSuccess() ) return sc; 00159 00160 MsgStream log(msgSvc(), name()); 00161 00162 ListAlg::iterator ita; 00163 // Start all the new TopAlgs. In fact Algorithms are protected against getting 00164 // started twice. 00165 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00166 sc = (*ita)->sysStart(); 00167 if( !sc.isSuccess() ) { 00168 log << MSG::ERROR << "Unable to start Algorithm: " << (*ita)->name() << endmsg; 00169 return sc; 00170 } 00171 } 00172 for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00173 sc = (*ita)->sysStart(); 00174 if( !sc.isSuccess() ) { 00175 log << MSG::ERROR << "Unable to start Output Stream: " << (*ita)->name() << endmsg; 00176 return sc; 00177 } 00178 } 00179 return StatusCode::SUCCESS; 00180 }
| StatusCode MinimalEventLoopMgr::stop | ( | ) | [virtual] |
implementation of IService::stop
Reimplemented from Service.
Reimplemented in EventLoopMgr.
Definition at line 184 of file MinimalEventLoopMgr.cpp.
00184 { 00185 00186 StatusCode sc = StatusCode::SUCCESS; 00187 00188 MsgStream log(msgSvc(), name()); 00189 00190 ListAlg::iterator ita; 00191 // Stop all the TopAlgs. In fact Algorithms are protected against getting 00192 // stopped twice. 00193 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00194 sc = (*ita)->sysStop(); 00195 if( !sc.isSuccess() ) { 00196 log << MSG::ERROR << "Unable to stop Algorithm: " << (*ita)->name() << endmsg; 00197 return sc; 00198 } 00199 } 00200 for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00201 sc = (*ita)->sysStop(); 00202 if( !sc.isSuccess() ) { 00203 log << MSG::ERROR << "Unable to stop Output Stream: " << (*ita)->name() << endmsg; 00204 return sc; 00205 } 00206 } 00207 00208 return Service::stop(); 00209 }
| StatusCode MinimalEventLoopMgr::finalize | ( | ) | [virtual] |
implementation of IService::finalize
Reimplemented from Service.
Reimplemented in EventLoopMgr.
Definition at line 267 of file MinimalEventLoopMgr.cpp.
00267 { 00268 MsgStream log( msgSvc(), name() ); 00269 StatusCode sc = StatusCode::SUCCESS; 00270 StatusCode scRet = StatusCode::SUCCESS; 00271 // Call the finalize() method of all top algorithms 00272 ListAlg::iterator ita; 00273 for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00274 sc = (*ita)->sysFinalize(); 00275 if( !sc.isSuccess() ) { 00276 scRet = StatusCode::FAILURE; 00277 log << MSG::WARNING << "Finalization of algorithm " << (*ita)->name() << " failed" << endmsg; 00278 } 00279 } 00280 // Call the finalize() method of all Output streams 00281 for ( ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00282 sc = (*ita)->sysFinalize(); 00283 if( !sc.isSuccess() ) { 00284 scRet = StatusCode::FAILURE; 00285 log << MSG::WARNING << "Finalization of algorithm " << (*ita)->name() << " failed" << endmsg; 00286 } 00287 } 00288 // release all top algorithms 00289 SmartIF<IAlgManager> algMan(serviceLocator()); 00290 for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00291 if (algMan->removeAlgorithm(*ita).isFailure()) { 00292 scRet = StatusCode::FAILURE; 00293 log << MSG::ERROR << "Problems removing Algorithm " << (*ita)->name() 00294 << endmsg; 00295 } 00296 } 00297 m_topAlgList.clear(); 00298 00299 // release all output streams 00300 for ( ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00301 (*ita)->release(); 00302 } 00303 m_outStreamList.clear(); 00304 if ( sc.isSuccess() ) m_state = FINALIZED; 00305 00306 m_incidentSvc->removeListener(m_abortEventListener, IncidentType::AbortEvent); 00307 m_abortEventListener = 0; // release 00308 00309 m_incidentSvc = 0; // release 00310 m_appMgrUI = 0; // release 00311 00312 sc = Service::finalize(); 00313 00314 if (sc.isFailure()) { 00315 scRet = StatusCode::FAILURE; 00316 log << MSG::ERROR << "Problems finalizing Service base class" << endmsg; 00317 } 00318 00319 return scRet; 00320 }
| StatusCode MinimalEventLoopMgr::reinitialize | ( | ) | [virtual] |
implementation of IService::reinitialize
Reimplemented from Service.
Reimplemented in EventLoopMgr.
Definition at line 214 of file MinimalEventLoopMgr.cpp.
00214 { 00215 MsgStream log( msgSvc(), name() ); 00216 StatusCode sc = StatusCode::SUCCESS; 00217 ListAlg::iterator ita; 00218 00219 // Reinitialize all the TopAlgs. 00220 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00221 sc = (*ita)->sysReinitialize(); 00222 if( !sc.isSuccess() ) { 00223 log << MSG::ERROR << "Unable to reinitialize Algorithm: " << (*ita)->name() << endmsg; 00224 return sc; 00225 } 00226 } 00227 for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00228 sc = (*ita)->sysReinitialize(); 00229 if( !sc.isSuccess() ) { 00230 log << MSG::ERROR << "Unable to reinitialize Output Stream: " << (*ita)->name() << endmsg; 00231 return sc; 00232 } 00233 } 00234 00235 return sc; 00236 }
| StatusCode MinimalEventLoopMgr::restart | ( | ) | [virtual] |
implementation of IService::restart
Reimplemented from Service.
Definition at line 240 of file MinimalEventLoopMgr.cpp.
00240 { 00241 MsgStream log( msgSvc(), name() ); 00242 StatusCode sc = StatusCode::SUCCESS; 00243 ListAlg::iterator ita; 00244 00245 // Restart all the TopAlgs. 00246 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00247 sc = (*ita)->sysRestart(); 00248 if( !sc.isSuccess() ) { 00249 log << MSG::ERROR << "Unable to restart Algorithm: " << (*ita)->name() << endmsg; 00250 return sc; 00251 } 00252 } 00253 for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) { 00254 sc = (*ita)->sysRestart(); 00255 if( !sc.isSuccess() ) { 00256 log << MSG::ERROR << "Unable to restart Output Stream: " << (*ita)->name() << endmsg; 00257 return sc; 00258 } 00259 } 00260 00261 return sc; 00262 }
| StatusCode MinimalEventLoopMgr::nextEvent | ( | int | maxevt | ) | [virtual] |
implementation of IEventProcessor::nextEvent
Implements IEventProcessor.
Reimplemented in EventLoopMgr.
Definition at line 325 of file MinimalEventLoopMgr.cpp.
00325 { 00326 MsgStream log(msgSvc(), name()); 00327 log << MSG::ERROR << "This method cannot be called on an object of type " 00328 << System::typeinfoName(typeid(*this)) << endmsg; 00329 return StatusCode::FAILURE; 00330 }
| StatusCode MinimalEventLoopMgr::executeEvent | ( | void * | par | ) | [virtual] |
implementation of IEventProcessor::executeEvent(void* par)
Implements IEventProcessor.
Reimplemented in EventLoopMgr.
Definition at line 396 of file MinimalEventLoopMgr.cpp.
00396 { 00397 bool eventfailed = false; 00398 00399 // Call the resetExecuted() method of ALL "known" algorithms 00400 // (before we were reseting only the topalgs) 00401 SmartIF<IAlgManager> algMan(serviceLocator()); 00402 if ( algMan.isValid() ) { 00403 const ListAlgPtrs& allAlgs = algMan->getAlgorithms() ; 00404 for( ListAlgPtrs::const_iterator ialg = allAlgs.begin() ; allAlgs.end() != ialg ; ++ialg ) { 00405 if ( 0 != *ialg ) (*ialg)->resetExecuted(); 00406 } 00407 } 00408 00409 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard 00410 const SmartIF<IProperty> appmgr(serviceLocator()); 00411 // Call the execute() method of all top algorithms 00412 for (ListAlg::iterator ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00413 StatusCode sc(StatusCode::FAILURE); 00414 try { 00415 if (m_abortEvent){ 00416 MsgStream log ( msgSvc() , name() ); 00417 log << MSG::DEBUG << "AbortEvent incident fired by " 00418 << m_abortEventSource << endmsg; 00419 m_abortEvent = false; 00420 sc.ignore(); 00421 break; 00422 } 00423 RetCodeGuard rcg(appmgr, Gaudi::ReturnCode::UnhandledException); 00424 sc = (*ita)->sysExecute(); 00425 rcg.ignore(); // disarm the guard 00426 } catch ( const GaudiException& Exception ) { 00427 MsgStream log ( msgSvc() , "MinimalEventLoopMgr.executeEvent()" ); 00428 log << MSG::FATAL << " Exception with tag=" << Exception.tag() 00429 << " thrown by " << (*ita)->name() << endmsg; 00430 log << MSG::ERROR << Exception << endmsg; 00431 } catch ( const std::exception& Exception ) { 00432 MsgStream log ( msgSvc() , "MinimalEventLoopMgr.executeEvent()" ); 00433 log << MSG::FATAL << " Standard std::exception thrown by " 00434 << (*ita)->name() << endmsg; 00435 log << MSG::ERROR << Exception.what() << endmsg; 00436 } catch(...) { 00437 MsgStream log ( msgSvc() , "MinimalEventLoopMgr.executeEvent()" ); 00438 log << MSG::FATAL << "UNKNOWN Exception thrown by " 00439 << (*ita)->name() << endmsg; 00440 } 00441 00442 if( !sc.isSuccess() ) { 00443 MsgStream log( msgSvc(), name() ); 00444 log << MSG::WARNING << "Execution of algorithm " << (*ita)->name() << " failed" << endmsg; 00445 eventfailed = true; 00446 } 00447 } 00448 00449 // ensure that the abortEvent flag is cleared before the next event 00450 if (m_abortEvent){ 00451 if (outputLevel() <= MSG::DEBUG) { 00452 MsgStream log ( msgSvc() , name() ); 00453 log << MSG::DEBUG << "AbortEvent incident fired by " 00454 << m_abortEventSource << endmsg; 00455 } 00456 m_abortEvent = false; 00457 } 00458 00459 // Call the execute() method of all output streams 00460 for (ListAlg::iterator ito = m_outStreamList.begin(); ito != m_outStreamList.end(); ito++ ) { 00461 (*ito)->resetExecuted(); 00462 StatusCode sc; 00463 sc = (*ito)->sysExecute(); 00464 if( !sc.isSuccess() ) { 00465 MsgStream log( msgSvc(), name() ); 00466 log << MSG::WARNING << "Execution of output stream " << (*ito)->name() << " failed" << endmsg; 00467 eventfailed = true; 00468 } 00469 } 00470 00471 // Check if there was an error processing current event 00472 if( eventfailed ){ 00473 MsgStream log( msgSvc(), name() ); 00474 log << MSG::ERROR << "Error processing event loop." << endmsg; 00475 return StatusCode(StatusCode::FAILURE,true); 00476 } 00477 return StatusCode(StatusCode::SUCCESS,true); 00478 }
| StatusCode MinimalEventLoopMgr::executeRun | ( | int | maxevt | ) | [virtual] |
implementation of IEventProcessor::executeRun( )
Implements IEventProcessor.
Reimplemented in EventLoopMgr.
Definition at line 335 of file MinimalEventLoopMgr.cpp.
00335 { 00336 StatusCode sc; 00337 MsgStream log( msgSvc(), name() ); 00338 ListAlg::iterator ita; 00339 bool eventfailed = false; 00340 00341 // Call the beginRun() method of all top algorithms 00342 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00343 sc = (*ita)->sysBeginRun(); 00344 if( !sc.isSuccess() ) { 00345 log << MSG::WARNING << "beginRun() of algorithm " << (*ita)->name() << " failed" << endmsg; 00346 eventfailed = true; 00347 } 00348 } 00349 00350 // Call now the nextEvent(...) 00351 sc = nextEvent(maxevt); 00352 if( !sc.isSuccess() ) { 00353 eventfailed = true; 00354 } 00355 00356 // Call the endRun() method of all top algorithms 00357 for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) { 00358 sc = (*ita)->sysEndRun(); 00359 if( !sc.isSuccess() ) { 00360 log << MSG::WARNING << "endRun() of algorithm " << (*ita)->name() << " failed" << endmsg; 00361 eventfailed = true; 00362 } 00363 } 00364 00365 if( eventfailed ){ 00366 return StatusCode::FAILURE; 00367 } 00368 else { 00369 return StatusCode::SUCCESS; 00370 } 00371 }
| StatusCode MinimalEventLoopMgr::stopRun | ( | ) | [virtual] |
implementation of IEventProcessor::stopRun( )
Implements IEventProcessor.
Definition at line 482 of file MinimalEventLoopMgr.cpp.
00482 { 00483 // Set the application return code 00484 SmartIF<IProperty> appmgr(serviceLocator()); 00485 if(Gaudi::setAppReturnCode(appmgr, Gaudi::ReturnCode::ScheduledStop).isFailure()) { 00486 MsgStream( msgSvc(), name() ) 00487 << MSG::ERROR << "Could not set return code of the application (" 00488 << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg; 00489 } 00490 m_scheduledStop = true; 00491 return StatusCode::SUCCESS; 00492 }
| void MinimalEventLoopMgr::topAlgHandler | ( | Property & | p | ) |
Top algorithm List handler.
Definition at line 497 of file MinimalEventLoopMgr.cpp.
00497 { 00498 if ( !(decodeTopAlgs( )).isSuccess() ) { 00499 throw GaudiException("Failed to initialize Top Algorithms streams.", 00500 "MinimalEventLoopMgr::topAlgHandler", 00501 StatusCode::FAILURE); 00502 } 00503 }
| StatusCode MinimalEventLoopMgr::decodeTopAlgs | ( | ) |
decodeTopAlgNameList & topAlgNameListHandler
Definition at line 508 of file MinimalEventLoopMgr.cpp.
00508 { 00509 StatusCode sc = StatusCode::SUCCESS; 00510 if ( CONFIGURED == m_state || INITIALIZED == m_state ) { 00511 SmartIF<IAlgManager> algMan(serviceLocator()); 00512 MsgStream log(msgSvc(), name()); 00513 if ( algMan.isValid()) { 00514 // Reset the existing Top Algorithm List 00515 m_topAlgList.clear( ); 00516 const std::vector<std::string>& algNames = m_topAlgNames.value( ); 00517 for (VectorName::const_iterator it = algNames.begin(); it != algNames.end(); it++) { 00518 Gaudi::Utils::TypeNameString item(*it); 00519 // Got the type and name. Now creating the algorithm, avoiding duplicate creation. 00520 std::string item_name = item.name() + getGaudiThreadIDfromName(name()); 00521 const bool CREATE = false; 00522 SmartIF<IAlgorithm> alg = algMan->algorithm(item_name, CREATE); 00523 if (alg.isValid()) { 00524 log << MSG::DEBUG << "Top Algorithm " << item_name << " already exists" << endmsg; 00525 } 00526 else { 00527 log << MSG::DEBUG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg; 00528 IAlgorithm *ialg = 0; 00529 StatusCode sc1 = algMan->createAlgorithm(item.type(), item_name, ialg); 00530 if( !sc1.isSuccess() ) { 00531 log << MSG::ERROR << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg; 00532 return sc1; 00533 } 00534 alg = ialg; // manage reference counting 00535 } 00536 m_topAlgList.push_back(alg); 00537 } 00538 return sc; 00539 } 00540 sc = StatusCode::FAILURE; 00541 } 00542 return sc; 00543 }
| void MinimalEventLoopMgr::outStreamHandler | ( | Property & | p | ) |
Output stream List handler.
Definition at line 548 of file MinimalEventLoopMgr.cpp.
00548 { 00549 if ( !(decodeOutStreams( )).isSuccess() ) { 00550 throw GaudiException("Failed to initialize output streams.", 00551 "MinimalEventLoopMgr::outStreamHandler", 00552 StatusCode::FAILURE); 00553 } 00554 }
| StatusCode MinimalEventLoopMgr::decodeOutStreams | ( | ) |
decodeOutStreamNameList & outStreamNameListHandler
Definition at line 559 of file MinimalEventLoopMgr.cpp.
00559 { 00560 StatusCode sc = StatusCode::SUCCESS; 00561 if ( CONFIGURED == m_state || INITIALIZED == m_state ) { 00562 MsgStream log(msgSvc(), name()); 00563 SmartIF<IAlgManager> algMan(serviceLocator()); 00564 if ( algMan.isValid() ) { 00565 // Reset the existing Top Algorithm List 00566 m_outStreamList.clear(); 00567 const std::vector<std::string>& algNames = m_outStreamNames.value( ); 00568 for (VectorName::const_iterator it = algNames.begin(); it != algNames.end(); it++) { 00569 Gaudi::Utils::TypeNameString item(*it, m_outStreamType); 00570 log << MSG::DEBUG << "Creating " << m_outStreamType << (*it) << endmsg; 00571 const bool CREATE = false; 00572 SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE ); 00573 if (os.isValid()) { 00574 log << MSG::DEBUG << "Output Stream " << item.name() << " already exists" << endmsg; 00575 } 00576 else { 00577 log << MSG::DEBUG << "Creating Output Stream " << (*it) << endmsg; 00578 IAlgorithm* ios = 0; 00579 StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios ); 00580 if( !sc1.isSuccess() ) { 00581 log << MSG::ERROR << "Unable to create Output Stream " << (*it) << endmsg; 00582 return sc1; 00583 } 00584 os = ios; // manage reference counting 00585 } 00586 m_outStreamList.push_back( os ); 00587 } 00588 return sc; 00589 } 00590 sc = StatusCode::FAILURE; 00591 } 00592 return sc; 00593 }
| MinimalEventLoopMgr& MinimalEventLoopMgr::operator= | ( | const MinimalEventLoopMgr & | ) | [private] |
Fake assignment operator (never implemented).
SmartIF<IAppMgrUI> MinimalEventLoopMgr::m_appMgrUI [protected] |
Reference to the IAppMgrUI interface of the application manager.
Definition at line 39 of file MinimalEventLoopMgr.h.
SmartIF<IIncidentSvc> MinimalEventLoopMgr::m_incidentSvc [protected] |
ListAlg MinimalEventLoopMgr::m_topAlgList [protected] |
ListAlg MinimalEventLoopMgr::m_outStreamList [protected] |
std::string MinimalEventLoopMgr::m_outStreamType [protected] |
State MinimalEventLoopMgr::m_state [protected] |
State of the object.
Reimplemented from Service.
Definition at line 53 of file MinimalEventLoopMgr.h.
bool MinimalEventLoopMgr::m_scheduledStop [protected] |
Instance of the incident listener waiting for AbortEvent.
Definition at line 57 of file MinimalEventLoopMgr.h.
bool MinimalEventLoopMgr::m_abortEvent [protected] |
Flag signalling that the event being processedhas to be aborted (skip all following top algs).
Definition at line 60 of file MinimalEventLoopMgr.h.
std::string MinimalEventLoopMgr::m_abortEventSource [protected] |