| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# MinimalEventLoopMgr Class Reference

This is the default processing manager of the application manager. More...

`#include <MinimalEventLoopMgr.h>`

Inheritance diagram for MinimalEventLoopMgr:

[legend]
Collaboration diagram for MinimalEventLoopMgr:

[legend]

List of all members.

## 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).

## Detailed Description

This is the default processing manager of the application manager.

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.

Author:
  Markus Frank

Version:
  1.0

Definition at line 26 of file MinimalEventLoopMgr.h.

## Member Typedef Documentation

typedef std::list<SmartIF<IAlgorithm> > MinimalEventLoopMgr::ListAlg

Creator friend class.

Definition at line 30 of file MinimalEventLoopMgr.h.

typedef std::list<IAlgorithm*> MinimalEventLoopMgr::ListAlgPtrs

Definition at line 31 of file MinimalEventLoopMgr.h.

typedef std::list<std::string> MinimalEventLoopMgr::ListName

Definition at line 32 of file MinimalEventLoopMgr.h.

typedef std::vector<std::string> MinimalEventLoopMgr::VectorName

Definition at line 33 of file MinimalEventLoopMgr.h.

## Member Enumeration Documentation

enum MinimalEventLoopMgr::State`[protected]`

Enumerator:

  OFFLINE |
  CONFIGURED |
  FINALIZED |
  INITIALIZED |

Definition at line 37 of file MinimalEventLoopMgr.h.

    00037 { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };

## Constructor & Destructor Documentation

MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const std::string & | nam,
|  | ISvcLocator * | svcLoc |
| ) |  |  |

Standard Constructor.

Definition at line 44 of file MinimalEventLoopMgr.cpp.

    00045   : base_class(nam, svcLoc), m_appMgrUI(svcLoc)
    00046 {
    00047   declareProperty("TopAlg",         m_topAlgNames );
    00048   declareProperty("OutStream",      m_outStreamNames );
    00049   declareProperty("OutStreamType",  m_outStreamType = "OutputStream");
    00050   m_topAlgNames.declareUpdateHandler   ( &MinimalEventLoopMgr::topAlgHandler, this );
    00051   m_outStreamNames.declareUpdateHandler( &MinimalEventLoopMgr::outStreamHandler, this );
    00052   m_state = OFFLINE;
    00053   m_scheduledStop = false;
    00054   m_abortEvent = false;
    00055 }

MinimalEventLoopMgr::~MinimalEventLoopMgr | ( |  | ) | `[virtual]`

Standard Destructor.

Definition at line 60 of file MinimalEventLoopMgr.cpp.

    00060                                             {
    00061   m_state = OFFLINE;
    00062 }

MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const MinimalEventLoopMgr & |  | ) | `[private]`

Fake copy constructor (never implemented).

## Member Function Documentation

StatusCode MinimalEventLoopMgr::initialize | ( |  | ) | `[virtual]`

implementation of IService::initialize

Reimplemented from Service.

Reimplemented in EventLoopMgr.

Definition at line 67 of file MinimalEventLoopMgr.cpp.

    00067                                               {
    00068
    00069   MsgStream log(msgSvc(), name());
    00070
    00071   if ( !m_appMgrUI.isValid() ) {
    00072     return StatusCode::FAILURE;
    00073   }
    00074
    00075   StatusCode sc = Service::initialize();
    00076   if ( !sc.isSuccess() )   {
    00077     log << MSG::ERROR << "Failed to initialize Service Base class." << endmsg;
    00078     return StatusCode::FAILURE;
    00079   }
    00080
    00081   SmartIF<IProperty> prpMgr(serviceLocator());
    00082   if ( ! prpMgr.isValid() )   {
    00083     log << MSG::ERROR << "Error retrieving AppMgr interface IProperty." << endmsg;
    00084     return StatusCode::FAILURE;
    00085   }
    00086   else {
    00087     if ( m_topAlgNames.value().size() == 0 )    {
    00088       setProperty(prpMgr->getProperty("TopAlg")).ignore();
    00089     }
    00090     if ( m_outStreamNames.value().size() == 0 )   {
    00091       setProperty(prpMgr->getProperty("OutStream")).ignore();
    00092     }
    00093   }
    00094
    00095   // Get the references to the services that are needed by the ApplicationMgr itself
    00096   m_incidentSvc = serviceLocator()->service("IncidentSvc");
    00097   if( !m_incidentSvc.isValid() )  {
    00098     log << MSG::FATAL << "Error retrieving IncidentSvc." << endmsg;
    00099     return StatusCode::FAILURE;
    00100   }
    00101
    00102   m_abortEventListener = new AbortEventListener(m_abortEvent,m_abortEventSource);
    00103   m_incidentSvc->addListener(m_abortEventListener,IncidentType::AbortEvent);
    00104
    00105   // The state is changed at this moment to allow decodeXXXX() to do something
    00106   m_state = INITIALIZED;
    00107
    00108   //--------------------------------------------------------------------------------------------
    00109   // Create output streams. Do not initialize them yet.
    00110   // The state is updated temporarily in order to enable the handler, which
    00111   // is also triggered by a change to the "OutputStream" Property.
    00112   //--------------------------------------------------------------------------------------------
    00113   sc = decodeOutStreams();
    00114   if ( !sc.isSuccess() )    {
    00115     log << MSG::ERROR << "Failed to initialize Output streams." << endmsg;
    00116     m_state = CONFIGURED;
    00117     return sc;
    00118   }
    00119   //--------------------------------------------------------------------------------------------
    00120   // Create all needed Top Algorithms. Do not initialize them yet.
    00121   // The state is updated temporarily in order to enable the handler, which
    00122   // is also triggered by a change to the "TopAlg" Property.
    00123   //--------------------------------------------------------------------------------------------
    00124   sc = decodeTopAlgs();
    00125   if ( !sc.isSuccess() )    {
    00126     log << MSG::ERROR << "Failed to initialize Top Algorithms streams." << endmsg;
    00127     m_state = CONFIGURED;
    00128     return sc;
    00129   }
    00130
    00131   ListAlg::iterator ita;
    00132   // Initialize all the new TopAlgs. In fact Algorithms are protected against getting
    00133   // initialized twice.
    00134   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00135     sc = (*ita)->sysInitialize();
    00136     if( !sc.isSuccess() ) {
    00137       log << MSG::ERROR << "Unable to initialize Algorithm: " << (*ita)->name() << endmsg;
    00138       return sc;
    00139     }
    00140   }
    00141   for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00142     sc = (*ita)->sysInitialize();
    00143     if( !sc.isSuccess() ) {
    00144       log << MSG::ERROR << "Unable to initialize Output Stream: " << (*ita)->name() << endmsg;
    00145       return sc;
    00146     }
    00147   }
    00148
    00149   return StatusCode::SUCCESS;
    00150 }

StatusCode MinimalEventLoopMgr::start | ( |  | ) | `[virtual]`

implementation of IService::start

Reimplemented from Service.

Definition at line 154 of file MinimalEventLoopMgr.cpp.

    00154                                          {
    00155
    00156   StatusCode sc = Service::start();
    00157   if ( ! sc.isSuccess() ) return sc;
    00158
    00159   MsgStream log(msgSvc(), name());
    00160
    00161   ListAlg::iterator ita;
    00162   // Start all the new TopAlgs. In fact Algorithms are protected against getting
    00163   // started twice.
    00164   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00165     sc = (*ita)->sysStart();
    00166     if( !sc.isSuccess() ) {
    00167       log << MSG::ERROR << "Unable to start Algorithm: " << (*ita)->name() << endmsg;
    00168       return sc;
    00169     }
    00170   }
    00171   for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00172     sc = (*ita)->sysStart();
    00173     if( !sc.isSuccess() ) {
    00174       log << MSG::ERROR << "Unable to start Output Stream: " << (*ita)->name() << endmsg;
    00175       return sc;
    00176     }
    00177   }
    00178   return StatusCode::SUCCESS;
    00179 }

StatusCode MinimalEventLoopMgr::stop | ( |  | ) | `[virtual]`

implementation of IService::stop

Reimplemented from Service.

Reimplemented in EventLoopMgr.

Definition at line 183 of file MinimalEventLoopMgr.cpp.

    00183                                         {
    00184
    00185   StatusCode sc = StatusCode::SUCCESS;
    00186
    00187   MsgStream log(msgSvc(), name());
    00188
    00189   ListAlg::iterator ita;
    00190   // Stop all the TopAlgs. In fact Algorithms are protected against getting
    00191   // stopped twice.
    00192   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00193     sc = (*ita)->sysStop();
    00194     if( !sc.isSuccess() ) {
    00195       log << MSG::ERROR << "Unable to stop Algorithm: " << (*ita)->name() << endmsg;
    00196       return sc;
    00197     }
    00198   }
    00199   for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00200     sc = (*ita)->sysStop();
    00201     if( !sc.isSuccess() ) {
    00202       log << MSG::ERROR << "Unable to stop Output Stream: " << (*ita)->name() << endmsg;
    00203       return sc;
    00204     }
    00205   }
    00206
    00207   return Service::stop();
    00208 }

StatusCode MinimalEventLoopMgr::finalize | ( | void |  | ) | `[virtual]`

implementation of IService::finalize

Reimplemented from Service.

Reimplemented in EventLoopMgr.

Definition at line 266 of file MinimalEventLoopMgr.cpp.

    00266                                             {
    00267   MsgStream log( msgSvc(), name() );
    00268   StatusCode sc = StatusCode::SUCCESS;
    00269   StatusCode scRet = StatusCode::SUCCESS;
    00270   // Call the finalize() method of all top algorithms
    00271   ListAlg::iterator ita;
    00272   for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00273     sc = (*ita)->sysFinalize();
    00274     if( !sc.isSuccess() ) {
    00275       scRet = StatusCode::FAILURE;
    00276       log << MSG::WARNING << "Finalization of algorithm " << (*ita)->name() << " failed" << endmsg;
    00277     }
    00278   }
    00279   // Call the finalize() method of all Output streams
    00280   for ( ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00281     sc = (*ita)->sysFinalize();
    00282     if( !sc.isSuccess() ) {
    00283       scRet = StatusCode::FAILURE;
    00284       log << MSG::WARNING << "Finalization of algorithm " << (*ita)->name() << " failed" << endmsg;
    00285     }
    00286   }
    00287   // release all top algorithms
    00288   SmartIF<IAlgManager> algMan(serviceLocator());
    00289   for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00290     if (algMan->removeAlgorithm(*ita).isFailure()) {
    00291       scRet = StatusCode::FAILURE;
    00292       log << MSG::ERROR << "Problems removing Algorithm " << (*ita)->name()
    00293           << endmsg;
    00294     }
    00295   }
    00296   m_topAlgList.clear();
    00297
    00298   // release all output streams
    00299   for ( ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00300     (*ita)->release();
    00301   }
    00302   m_outStreamList.clear();
    00303   if ( sc.isSuccess() ) m_state = FINALIZED;
    00304
    00305   m_incidentSvc->removeListener(m_abortEventListener, IncidentType::AbortEvent);
    00306   m_abortEventListener = 0; // release
    00307
    00308   m_incidentSvc = 0; // release
    00309   m_appMgrUI = 0; // release
    00310
    00311   sc = Service::finalize();
    00312
    00313   if (sc.isFailure()) {
    00314     scRet = StatusCode::FAILURE;
    00315     log << MSG::ERROR << "Problems finalizing Service base class" << endmsg;
    00316   }
    00317
    00318   return scRet;
    00319 }

StatusCode MinimalEventLoopMgr::reinitialize | ( |  | ) | `[virtual]`

implementation of IService::reinitialize

Reimplemented from Service.

Reimplemented in EventLoopMgr.

Definition at line 213 of file MinimalEventLoopMgr.cpp.

    00213                                              {
    00214   MsgStream log( msgSvc(), name() );
    00215   StatusCode sc = StatusCode::SUCCESS;
    00216   ListAlg::iterator ita;
    00217
    00218   // Reinitialize all the TopAlgs.
    00219   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00220     sc = (*ita)->sysReinitialize();
    00221     if( !sc.isSuccess() ) {
    00222       log << MSG::ERROR << "Unable to reinitialize Algorithm: " << (*ita)->name() << endmsg;
    00223       return sc;
    00224     }
    00225   }
    00226   for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00227     sc = (*ita)->sysReinitialize();
    00228     if( !sc.isSuccess() ) {
    00229       log << MSG::ERROR << "Unable to reinitialize Output Stream: " << (*ita)->name() << endmsg;
    00230       return sc;
    00231     }
    00232   }
    00233
    00234   return sc;
    00235 }

StatusCode MinimalEventLoopMgr::restart | ( |  | ) | `[virtual]`

implementation of IService::restart

Reimplemented from Service.

Definition at line 239 of file MinimalEventLoopMgr.cpp.

    00239                                         {
    00240   MsgStream log( msgSvc(), name() );
    00241   StatusCode sc = StatusCode::SUCCESS;
    00242   ListAlg::iterator ita;
    00243
    00244   // Restart all the TopAlgs.
    00245   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00246     sc = (*ita)->sysRestart();
    00247     if( !sc.isSuccess() ) {
    00248       log << MSG::ERROR << "Unable to restart Algorithm: " << (*ita)->name() << endmsg;
    00249       return sc;
    00250     }
    00251   }
    00252   for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
    00253     sc = (*ita)->sysRestart();
    00254     if( !sc.isSuccess() ) {
    00255       log << MSG::ERROR << "Unable to restart Output Stream: " << (*ita)->name() << endmsg;
    00256       return sc;
    00257     }
    00258   }
    00259
    00260   return sc;
    00261 }

StatusCode MinimalEventLoopMgr::nextEvent | ( | int | maxevt | ) | `[virtual]`

implementation of IEventProcessor::nextEvent

Implements IEventProcessor.

Reimplemented in EventLoopMgr.

Definition at line 324 of file MinimalEventLoopMgr.cpp.

    00324                                                             {
    00325   MsgStream log(msgSvc(), name());
    00326   log << MSG::ERROR << "This method cannot be called on an object of type "
    00327       << System::typeinfoName(typeid(*this)) << endmsg;
    00328   return StatusCode::FAILURE;
    00329 }

StatusCode MinimalEventLoopMgr::executeEvent | ( | void * | par | ) | `[virtual]`

implementation of IEventProcessor::executeEvent(void* par)

Implements IEventProcessor.

Reimplemented in EventLoopMgr.

Definition at line 375 of file MinimalEventLoopMgr.cpp.

    00375                                                                {
    00376   bool eventfailed = false;
    00377
    00378   // Call the resetExecuted() method of ALL "known" algorithms
    00379   // (before we were reseting only the topalgs)
    00380   SmartIF<IAlgManager> algMan(serviceLocator());
    00381   if ( algMan.isValid() ) {
    00382     const ListAlgPtrs& allAlgs = algMan->getAlgorithms() ;
    00383     for( ListAlgPtrs::const_iterator ialg = allAlgs.begin() ; allAlgs.end() != ialg ; ++ialg ) {
    00384       if ( 0 != *ialg ) (*ialg)->resetExecuted();
    00385     }
    00386   }
    00387
    00388   // Call the execute() method of all top algorithms
    00389   for (ListAlg::iterator ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00390     StatusCode sc(StatusCode::FAILURE);
    00391     try {
    00392       if (m_abortEvent){
    00393         MsgStream log ( msgSvc() , name() );
    00394         log << MSG::DEBUG << "AbortEvent incident fired by "
    00395                           << m_abortEventSource << endmsg;
    00396         m_abortEvent = false;
    00397         sc.ignore();
    00398         break;
    00399       }
    00400       sc = (*ita)->sysExecute();
    00401     } catch ( const GaudiException& Exception ) {
    00402       MsgStream log ( msgSvc() , "MinimalEventLoopMgr.executeEvent()" );
    00403       log << MSG::FATAL << " Exception with tag=" << Exception.tag()
    00404           << " thrown by " << (*ita)->name() << endmsg;
    00405       log << MSG::ERROR << Exception << endmsg;
    00406     } catch ( const std::exception& Exception ) {
    00407       MsgStream log ( msgSvc() , "MinimalEventLoopMgr.executeEvent()" );
    00408       log << MSG::FATAL << " Standard std::exception thrown by "
    00409           << (*ita)->name() << endmsg;
    00410       log << MSG::ERROR << Exception.what()  << endmsg;
    00411     } catch(...) {
    00412       MsgStream log ( msgSvc() , "MinimalEventLoopMgr.executeEvent()" );
    00413       log << MSG::FATAL << "UNKNOWN Exception thrown by "
    00414           << (*ita)->name() << endmsg;
    00415     }
    00416
    00417     if( !sc.isSuccess() )  {
    00418       MsgStream log( msgSvc(), name() );
    00419       log << MSG::WARNING << "Execution of algorithm " << (*ita)->name() << " failed" << endmsg;
    00420       eventfailed = true;
    00421     }
    00422   }
    00423
    00424   // ensure that the abortEvent flag is cleared before the next event
    00425   if (m_abortEvent){
    00426     if (outputLevel() <= MSG::DEBUG) {
    00427       MsgStream log ( msgSvc() , name() );
    00428       log << MSG::DEBUG << "AbortEvent incident fired by "
    00429                         << m_abortEventSource << endmsg;
    00430     }
    00431     m_abortEvent = false;
    00432   }
    00433
    00434   // Call the execute() method of all output streams
    00435   for (ListAlg::iterator ito = m_outStreamList.begin(); ito != m_outStreamList.end(); ito++ ) {
    00436     (*ito)->resetExecuted();
    00437       StatusCode sc;
    00438       sc = (*ito)->sysExecute();
    00439     if( !sc.isSuccess() )  {
    00440       MsgStream log( msgSvc(), name() );
    00441       log << MSG::WARNING << "Execution of output stream " << (*ito)->name() << " failed" << endmsg;
    00442       eventfailed = true;
    00443     }
    00444   }
    00445
    00446   // Check if there was an error processing current event
    00447   if( eventfailed ){
    00448     MsgStream log( msgSvc(), name() );
    00449     log << MSG::ERROR << "Error processing event loop." << endmsg;
    00450     return StatusCode(StatusCode::FAILURE,true);
    00451   }
    00452   return StatusCode(StatusCode::SUCCESS,true);
    00453 }

StatusCode MinimalEventLoopMgr::executeRun | ( | int | maxevt | ) | `[virtual]`

implementation of IEventProcessor::executeRun( )

Implements IEventProcessor.

Reimplemented in EventLoopMgr.

Definition at line 334 of file MinimalEventLoopMgr.cpp.

    00334                                                        {
    00335   StatusCode  sc;
    00336   MsgStream log( msgSvc(), name() );
    00337   ListAlg::iterator ita;
    00338   bool eventfailed = false;
    00339
    00340   // Call the beginRun() method of all top algorithms
    00341   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00342     sc = (*ita)->sysBeginRun();
    00343     if( !sc.isSuccess() ) {
    00344       log << MSG::WARNING << "beginRun() of algorithm " << (*ita)->name() << " failed" << endmsg;
    00345       eventfailed = true;
    00346     }
    00347   }
    00348
    00349   // Call now the nextEvent(...)
    00350   sc = nextEvent(maxevt);
    00351   if( !sc.isSuccess() ) {
    00352     eventfailed = true;
    00353   }
    00354
    00355   // Call the endRun() method of all top algorithms
    00356   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
    00357     sc = (*ita)->sysEndRun();
    00358     if( !sc.isSuccess() ) {
    00359       log << MSG::WARNING << "endRun() of algorithm " << (*ita)->name() << " failed" << endmsg;
    00360       eventfailed = true;
    00361     }
    00362   }
    00363
    00364   if( eventfailed ){
    00365     return StatusCode::FAILURE;
    00366   }
    00367   else {
    00368     return StatusCode::SUCCESS;
    00369   }
    00370 }

StatusCode MinimalEventLoopMgr::stopRun | ( |  | ) | `[virtual]`

implementation of IEventProcessor::stopRun( )

Implements IEventProcessor.

Definition at line 457 of file MinimalEventLoopMgr.cpp.

    00457                                         {
    00458   m_scheduledStop = true;
    00459   return StatusCode::SUCCESS;
    00460 }

void MinimalEventLoopMgr::topAlgHandler | ( | Property & | p | ) |

Top algorithm List handler.

Definition at line 465 of file MinimalEventLoopMgr.cpp.

    00465                                                                   {
    00466   if ( !(decodeTopAlgs( )).isSuccess() ) {
    00467     throw GaudiException("Failed to initialize Top Algorithms streams.",
    00468                          "MinimalEventLoopMgr::topAlgHandler",
    00469                          StatusCode::FAILURE);
    00470   }
    00471 }

StatusCode MinimalEventLoopMgr::decodeTopAlgs | ( |  | ) |

decodeTopAlgNameList & topAlgNameListHandler

Definition at line 476 of file MinimalEventLoopMgr.cpp.

    00476                                                  {
    00477   StatusCode sc = StatusCode::SUCCESS;
    00478   if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
    00479     SmartIF<IAlgManager> algMan(serviceLocator());
    00480     MsgStream log(msgSvc(), name());
    00481     if ( algMan.isValid())   {
    00482       // Reset the existing Top Algorithm List
    00483       m_topAlgList.clear( );
    00484       const std::vector<std::string>& algNames = m_topAlgNames.value( );
    00485       for (VectorName::const_iterator it = algNames.begin(); it != algNames.end(); it++) {
    00486         Gaudi::Utils::TypeNameString item(*it);
    00487         // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
    00488         std::string item_name = item.name() + getGaudiThreadIDfromName(name());
    00489         const bool CREATE = false;
    00490         SmartIF<IAlgorithm> alg = algMan->algorithm(item_name, CREATE);
    00491         if (alg.isValid()) {
    00492           log << MSG::DEBUG << "Top Algorithm " << item_name << " already exists" << endmsg;
    00493         }
    00494         else {
    00495           log << MSG::DEBUG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
    00496           IAlgorithm *ialg = 0;
    00497           StatusCode sc1 = algMan->createAlgorithm(item.type(), item_name, ialg);
    00498           if( !sc1.isSuccess() ) {
    00499             log << MSG::ERROR << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
    00500             return sc1;
    00501           }
    00502           alg = ialg; // manage reference counting
    00503         }
    00504         m_topAlgList.push_back(alg);
    00505       }
    00506       return sc;
    00507     }
    00508     sc = StatusCode::FAILURE;
    00509   }
    00510   return sc;
    00511 }

void MinimalEventLoopMgr::outStreamHandler | ( | Property & | p | ) |

Output stream List handler.

Definition at line 516 of file MinimalEventLoopMgr.cpp.

    00516                                                                             {
    00517   if ( !(decodeOutStreams( )).isSuccess() ) {
    00518     throw GaudiException("Failed to initialize output streams.",
    00519                          "MinimalEventLoopMgr::outStreamHandler",
    00520                          StatusCode::FAILURE);
    00521   }
    00522 }

StatusCode MinimalEventLoopMgr::decodeOutStreams | ( |  | ) |

decodeOutStreamNameList & outStreamNameListHandler

Definition at line 527 of file MinimalEventLoopMgr.cpp.

    00527                                                      {
    00528   StatusCode sc = StatusCode::SUCCESS;
    00529   if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
    00530     MsgStream log(msgSvc(), name());
    00531     SmartIF<IAlgManager> algMan(serviceLocator());
    00532     if ( algMan.isValid() )   {
    00533       // Reset the existing Top Algorithm List
    00534       m_outStreamList.clear();
    00535       const std::vector<std::string>& algNames = m_outStreamNames.value( );
    00536       for (VectorName::const_iterator it = algNames.begin(); it != algNames.end(); it++) {
    00537         Gaudi::Utils::TypeNameString item(*it, m_outStreamType);
    00538         log << MSG::DEBUG << "Creating " << m_outStreamType <<  (*it) << endmsg;
    00539         const bool CREATE = false;
    00540         SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
    00541         if (os.isValid()) {
    00542           log << MSG::DEBUG << "Output Stream " << item.name() << " already exists" << endmsg;
    00543         }
    00544         else {
    00545           log << MSG::DEBUG << "Creating Output Stream " << (*it) << endmsg;
    00546           IAlgorithm* ios = 0;
    00547           StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
    00548           if( !sc1.isSuccess() ) {
    00549             log << MSG::ERROR << "Unable to create Output Stream " << (*it) << endmsg;
    00550             return sc1;
    00551           }
    00552           os = ios; // manage reference counting
    00553         }
    00554         m_outStreamList.push_back( os );
    00555       }
    00556      return sc;
    00557     }
    00558     sc = StatusCode::FAILURE;
    00559   }
    00560   return sc;
    00561 }

MinimalEventLoopMgr& MinimalEventLoopMgr::operator= | ( | const MinimalEventLoopMgr & |  | ) | `[private]`

Fake assignment operator (never implemented).

## Member Data Documentation

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]`

Reference to the incident service.

Definition at line 41 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_topAlgList`[protected]`

List of top level algorithms.

Definition at line 43 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_outStreamList`[protected]`

List of output streams.

Definition at line 45 of file MinimalEventLoopMgr.h.

std::string MinimalEventLoopMgr::m_outStreamType`[protected]`

Out Stream type.

Definition at line 47 of file MinimalEventLoopMgr.h.

StringArrayProperty MinimalEventLoopMgr::m_topAlgNames`[protected]`

List of top level algorithms names.

Definition at line 49 of file MinimalEventLoopMgr.h.

StringArrayProperty MinimalEventLoopMgr::m_outStreamNames`[protected]`

List of output stream names.

Definition at line 51 of file MinimalEventLoopMgr.h.

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]`

Scheduled stop of event processing.

Definition at line 55 of file MinimalEventLoopMgr.h.

SmartIF<IIncidentListener> MinimalEventLoopMgr::m_abortEventListener`[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]`

Source of the AbortEvent incident.

Definition at line 62 of file MinimalEventLoopMgr.h.

The documentation for this class was generated from the following files:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiKernel/GaudiKernel/MinimalEventLoopMgr.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r8/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp