| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
ApplicationMgr Class Reference

The Application Manager class. More...

`#include <src/ApplicationMgr/ApplicationMgr.h>`

Inheritance diagram for ApplicationMgr:
[legend]
Collaboration diagram for ApplicationMgr:
[legend]

## Public Member Functions
| ApplicationMgr (IInterface *=nullptr)
StatusCode | queryInterface (const InterfaceID &iid, void **pinterface) override
StatusCode | run () override
StatusCode | configure () override
StatusCode | terminate () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | nextEvent (int maxevt) override
const std::string & | name () const override
EventContext | createEventContext () override
| implementation of IEventProcessor::createEventContext() More...
StatusCode | executeEvent (EventContext &&ctx) override
| implementation of IEventProcessor::executeEvent(void*) More...
StatusCode | executeRun (int evtmax) override
| implementation of IEventProcessor::executeRun(int) More...
StatusCode | stopRun () override
| implementation of IEventProcessor::stopRun() More...
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
StatusCode | sysStart () override
StatusCode | sysStop () override
StatusCode | sysFinalize () override
StatusCode | sysReinitialize () override
StatusCode | sysRestart () override
std::future< std::tuple< StatusCode, EventContext > > | asyncExecuteEvent (EventContext &&ctx) override
template<class I >
SmartIF< IComponentManager > & | getManager ()
SmartIF< ISvcManager > & | svcManager ()
SmartIF< IAlgManager > & | algManager ()
SmartIF< ISvcLocator > & | serviceLocator () const override
| Needed to locate the message service. More...
void | outputLevelUpdate () override
| Function to call to update the outputLevel of the components (after a change in MessageSvc). More...
void | printAlgsSequences ()
| Print the sequence of algorithms that have been loaded. More...
Gaudi::Details::PropertyBase handlers
void | evtLoopPropertyHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeExtSvcNameList ()
StatusCode | decodeCreateSvcNameList ()
void | createSvcNameListHandler (Gaudi::Details::PropertyBase &)
void | extSvcNameListHandler (Gaudi::Details::PropertyBase &theProp)
StatusCode | decodeDllNameList ()
void | dllNameListHandler (Gaudi::Details::PropertyBase &theProp)
void | pluginDebugPropertyHandler (Gaudi::Details::PropertyBase &theProp)
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Protected Types
typedef std::map< unsigned long, SmartIF< IComponentManager > > | ManagersMap
| Typedef for the map of component managers, the key is the "id" field of the basic InterfaceID of the managed components. More...

## Protected Member Functions
void | setServiceManager (ISvcManager *) override
StatusCode | i_startup ()
| Internal startup routine. More...
StatusCode | GoToState (Gaudi::StateMachine::State state, bool ignoreFailures=false)
| Reach a state from current state (whichever it is) going through the correct transitions. More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
ManagersMap | m_managers
| Map of known component managers. More...
Gaudi::Property< std::vector< std::string > > | m_declaredManagers
| Property to declare the list of known managers. More...
SmartIF< ISvcManager > | m_svcManager
| Cached pointer to the manager of services. More...
SmartIF< IAlgManager > | m_algManager
| Cached pointer to the manager of algorithms. More...
SmartIF< ISvcLocator > | m_svcLocator
| Reference to its own service locator (must be instantiated prior to any service!) More...
SmartIF< DLLClassManager > | m_classManager
| Reference to the class manager. More...
Gaudi::Property< int > | m_SIGo
Gaudi::Property< int > | m_SIExit
Gaudi::Property< std::vector< std::string > > | m_topAlgNameList
Gaudi::Property< std::vector< std::string > > | m_outStreamNameList
Gaudi::Property< std::string > | m_outStreamType
Gaudi::Property< std::string > | m_messageSvcType {this, "MessageSvcType", "MessageSvc", "MessageSvc type"}
Gaudi::Property< std::string > | m_jobOptionsSvcType {this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type"}
std::string | m_name = "ApplicationMgr"
| Name. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Internal State. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Internal State. More...
Gaudi::Property< std::vector< std::string > > | m_svcMapping {this, "SvcMapping", {}, "Default mapping of services"}
Gaudi::Property< std::vector< std::string > > | m_svcOptMapping
SmartIF< IMessageSvc > | m_messageSvc
| Reference to the message service. More...
SmartIF< IRunable > | m_runable
| Reference to the runable object. More...
SmartIF< IEventProcessor > | m_processingMgr
| Reference to processing manager object. More...
SmartIF< IJobOptionsSvc > | m_jobOptionsSvc
| Reference to JobOption service. More...
SmartIF< IAsyncEventProcessor > | m_asyncProcessor
| Reference to an asynchronous processing manager object. More...
Gaudi::Property< int > | m_evtMax {this, "EvtMax", -1, "Number of events to be processed (-1 means all events)"}
Gaudi::Property< std::vector< std::string > > | m_extSvcNameList {this, "ExtSvc", {}, "List of external services names"}
Gaudi::Property< bool > | m_extSvcCreates
Gaudi::Property< std::vector< std::string > > | m_dllNameList {this, "Dlls", {}, "List of DDL's names"}
Gaudi::Property< std::string > | m_jobOptionsType {this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)"}
Gaudi::Property< std::string > | m_jobOptionsPath {this, "JobOptionsPath", {}, "The \"file\" to look for properties"}
Gaudi::Property< std::string > | m_jobOptionsPreAction
Gaudi::Property< std::string > | m_jobOptionsPostAction
Gaudi::Property< std::string > | m_runableType {this, "Runable", "AppMgrRunable", "Runable type"}
Gaudi::Property< std::string > | m_eventLoopMgr {this, "EventLoop", "EventLoopMgr", "Processing manager type"}
Gaudi::Property< std::string > | m_evtsel {this, "EvtSel", {}, "Event selection"}
Gaudi::Property< std::string > | m_histPersName {this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc"}
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::INFO, "Message output level"}
Gaudi::Property< std::string > | m_appName {this, "AppName", "ApplicationMgr", "The name of the application"}
Gaudi::Property< std::string > | m_appVersion {this, "AppVersion", {}, "The version of the application"}
Gaudi::Property< bool > | m_actHistory {this, "ActivateHistory", false, "Activate HistorySvc"}
Gaudi::Property< bool > | m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
Gaudi::Property< int > | m_pluginDebugLevel
Gaudi::Property< std::vector< std::string > > | m_createSvcNameList
Gaudi::Property< bool > | m_auditTools {this, "AuditTools", false}
| Defaults for auditors. More...
Gaudi::Property< bool > | m_auditSvcs {this, "AuditServices", false}
Gaudi::Property< bool > | m_auditAlgs {this, "AuditAlgorithms", false}
Gaudi::Property< std::map< std::string, std::string > > | m_environment
Gaudi::Property< bool > | m_loopCheck
Gaudi::Property< bool > | m_stopOnSignal
| Property to enable/disable the "stop on signal" service. More...
Gaudi::Property< bool > | m_stalledEventMonitoring
| Property to enable/disable the monitoring and reporting of stalled events. More...
Gaudi::Property< bool > | m_propertiesPrint
Gaudi::Property< int > | m_returnCode
| Property to record the error conditions occurring during the running. More...
Gaudi::Property< bool > | m_printAlgsSequence
bool | m_useHiveAlgorithmManager

## Private Attributes
std::vector< std::string > | m_okDlls
| names of successfully loaded dlls More...

## Additional Inherited Members
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > >
using | base_class = CommonMessaging

## Detailed Description

The Application Manager class.

The main purpose of the Application Manager is to steer any data processing application. This includes all data processing applications for LHCb data in all stages: simulation, reconstruction, analysis, high level triggers, etc. Specific implementations of the ApplicationMgr will be developed to cope with the different environments (on-line, off-line, interactive, batch, etc.).

Author
  Pere Mato

Definition at line 45 of file ApplicationMgr.h.

## Member Typedef Documentation

## ◆ ManagersMap

typedef std::map<unsigned long, SmartIF<IComponentManager> > ApplicationMgr::ManagersMap
| protected

Typedef for the map of component managers, the key is the "id" field of the basic InterfaceID of the managed components.

Definition at line 158 of file ApplicationMgr.h.

## Constructor & Destructor Documentation

## ◆ ApplicationMgr()

ApplicationMgr::ApplicationMgr | ( | IInterface * | = `nullptr` | ) |

Definition at line 48 of file ApplicationMgr.cpp.

48 {
49 // IInterface initialization
50 addRef(); // Initial count set to 1
51
52 // Instantiate component managers
53 m_managers[IService::interfaceID().id()] = new ServiceManager( this );
54
55 m_svcLocator = svcManager();
56
57 // Instantiate internal services
58 // SvcLocator/Factory HAS to be already instantiated
59 m_classManager = new DLLClassManager( this );
60
61 AlgorithmManager* algMgr = new AlgorithmManager( this );
62 m_managers[IAlgorithm::interfaceID().id()] = algMgr;
63 // m_managers[IAlgorithm::interfaceID().id()] = new HiveAlgorithmManager(this);
64
65 // This property is not hosted in the ApplicationMgr instance
66 declareProperty( "AlgTypeAliases", algMgr->typeAliases(),
67 "Aliases of algorithm types, to replace an algorithm type for every instance" );
68
69 // ServiceMgr Initialization loop checking
70 svcManager()->setLoopCheckEnabled( m_loopCheck );
71
72 m_svcMapping = {"EvtDataSvc/EventDataSvc",
73 "DetDataSvc/DetectorDataSvc",
74 "HistogramSvc/HistogramDataSvc",
75 "HbookCnv::PersSvc/HbookHistSvc",
76 "RootHistCnv::PersSvc/RootHistSvc",
77 "EvtPersistencySvc/EventPersistencySvc",
78 "DetPersistencySvc/DetectorPersistencySvc",
79 "HistogramPersistencySvc/HistogramPersistencySvc"};
80 }
ServiceManager
The ServiceManager class is in charge of the creation of concrete instances of Services.
Definition: ServiceManager.h:36
AlgorithmManager
The AlgorithmManager class is in charge of the creation of concrete instances of Algorithms.
Definition: AlgorithmManager.h:31
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:162
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:95
AlgorithmManager::typeAliases
AlgTypeAliasesMap & typeAliases()
Definition: AlgorithmManager.h:82
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:173
DLLClassManager
Definition: DLLClassManager.h:28
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:206
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:175
ISvcManager::setLoopCheckEnabled
virtual void setLoopCheckEnabled(bool en=true)=0
Set the value of the initialization loop check flag.
ApplicationMgr::m_loopCheck
Gaudi::Property< bool > m_loopCheck
Definition: ApplicationMgr.h:262

## Member Function Documentation

## ◆ algManager()

SmartIF<IAlgManager>& ApplicationMgr::algManager | ( |  | ) |
| inline

Definition at line 128 of file ApplicationMgr.h.

128 {
129 // Cache the casted pointer to IAlgManager
130 if ( !m_algManager ) { m_algManager = getManager<IAlgorithm>(); }
131 return m_algManager;
132 }
ApplicationMgr::m_algManager
SmartIF< IAlgManager > m_algManager
Cached pointer to the manager of algorithms.
Definition: ApplicationMgr.h:170

## ◆ asyncExecuteEvent()

std::future< std::tuple< StatusCode, EventContext > > ApplicationMgr::asyncExecuteEvent | ( | EventContext && | ctx | ) |
| override

Definition at line 796 of file ApplicationMgr.cpp.

796 {
797 if ( m_state == Gaudi::StateMachine::RUNNING ) {
798 if ( LIKELY( bool( m_asyncProcessor ) ) ) {
799 return m_asyncProcessor->asyncExecuteEvent( std::move( ctx ) );
800 } else {
801 throw GaudiException{"asyncExecuteEvent: event processor is not an IAsyncEventProcessor", name(),
802 StatusCode::FAILURE};
803 }
804 }
805 std::stringstream s;
806 s << "asyncExecuteEvent: Invalid state \"" << FSMState() << '"';
807 throw GaudiException{s.str(), name(), StatusCode::FAILURE};
808 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
std::stringstream
STL class.
ApplicationMgr::m_asyncProcessor
SmartIF< IAsyncEventProcessor > m_asyncProcessor
Reference to an asynchronous processing manager object.
Definition: ApplicationMgr.h:215
std::move
T move(T... args)
LIKELY
#define LIKELY(x)
Definition: Kernel.h:95
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
gaudirun.s
string s
Definition: gaudirun.py:316
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:849
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846

## ◆ configure()

StatusCode ApplicationMgr::configure | ( |  | ) |
| override

Definition at line 221 of file ApplicationMgr.cpp.

221 {
222
223 // Check if the state is compatible with the transition
224 MsgStream tlog( m_messageSvc, name() );
225 if ( Gaudi::StateMachine::CONFIGURED == m_state ) {
226 tlog << MSG::INFO << "Already Configured" << endmsg;
227 return StatusCode::SUCCESS;
228 }
229 if ( Gaudi::StateMachine::OFFLINE != m_state ) {
230 tlog << MSG::FATAL << "configure: Invalid state \"" << m_state << "\"" << endmsg;
231 return StatusCode::FAILURE;
232 }
233 m_targetState = Gaudi::StateMachine::CONFIGURED;
234
235 // Reset application return code.
236 m_returnCode = Gaudi::ReturnCode::Success;
237
238 StatusCode sc;
239 sc = i_startup();
240 if ( !sc.isSuccess() ) { return sc; }
241
242 {
243 MsgStream log( m_messageSvc, name() );
244 // Get my own options using the Job options service
245 if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg;
246 sc = m_jobOptionsSvc->setMyProperties( name(), this );
247 if ( !sc.isSuccess() ) {
248 log << MSG::WARNING << "Problems getting my properties from JobOptionsSvc" << endmsg;
249 return sc;
250 }
251 }
252
253 // Make sure that the OutputLevel is in sync
254 if ( m_outputLevel != MSG::NIL && m_messageSvc ) m_messageSvc->setOutputLevel( name(), m_outputLevel );
255 MsgStream log( m_messageSvc, name() );
256
257 // Check current outputLevel to eventually inform the MessageSvc
258 if ( m_outputLevel != MSG::NIL && !m_appName.empty() ) {
259 // Print a welcome message
260 log << MSG::ALWAYS << std::endl
261 << "=================================================================="
262 << "==================================================================" << std::endl
263 << " "
264 << " Welcome to " << m_appName.value();
265
266 if ( !m_appVersion.empty() ) {
267 log << MSG::ALWAYS << " version " << m_appVersion.value();
268 } else {
269 log << MSG::ALWAYS << " (GaudiCoreSvc "
270 << "v" << GAUDICORESVC_MAJOR_VERSION << "r" << GAUDICORESVC_MINOR_VERSION
271 #if GAUDICORESVC_PATCH_VERSION
272 << "p" << GAUDICORESVC_PATCH_VERSION
273 #endif
274 << ")";
275 }
276
277 // Add the host name and current time to the message
278 log << MSG::ALWAYS << std::endl
279 << " "
280 << " running on " << System::hostName() << " on " << Gaudi::Time::current().format( true ) << std::endl
281 << "=================================================================="
282 << "==================================================================" << endmsg;
283 }
284
285 // print all own properties if the options "PropertiesPrint" is set to true
286 if ( m_propertiesPrint ) {
287 const auto& properties = getProperties();
288 log << MSG::ALWAYS << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
289 << " #properties = " << properties.size() << endmsg;
290 for ( const auto& property : properties ) { log << "Property ['Name': Value] = " << *property << endmsg; }
291 }
292
293 // Check if StatusCode need to be checked
294 if ( m_codeCheck ) {
295 StatusCode::enableChecking();
296 sc = svcManager()->addService( "StatusCodeSvc", -9999 );
297 if ( sc.isFailure() ) {
298 log << MSG::FATAL << "Error adding StatusCodeSvc" << endmsg;
299 return StatusCode::FAILURE;
300 } else {
301 ON_VERBOSE
302 log << MSG::VERBOSE << "added service StatusCodeSvc" << endmsg;
303 }
304 } else {
305 StatusCode::disableChecking();
306 }
307
308 // set the requested environment variables
309 for ( auto& var : m_environment ) {
310 const std::string& name = var.first;
311 const std::string& value = var.second;
312 std::string old = System::getEnv( name.c_str() );
313 const MSG::Level lvl = ( !old.empty() && ( old != "UNKNOWN" ) ) ? MSG::WARNING : MSG::DEBUG;
314 if ( UNLIKELY( m_outputLevel <= lvl ) ) log << lvl << "Setting " << name << " = " << value << endmsg;
315 System::setEnv( name, value );
316 }
317
318 // Declare Service Types
319 for ( auto& j : m_svcMapping ) {
320 Gaudi::Utils::TypeNameString itm( j );
321 if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
322 log << MSG::ERROR << "configure: declaring svc type:'" << j << "' failed." << endmsg;
323 return StatusCode::FAILURE;
324 } else {
325 ON_VERBOSE
326 log << MSG::VERBOSE << "declared service " << j << endmsg;
327 }
328 }
329 for ( auto& j : m_svcOptMapping ) {
330 Gaudi::Utils::TypeNameString itm( j );
331 if ( svcManager()->declareSvcType( itm.name(), itm.type() ).isFailure() ) {
332 log << MSG::ERROR << "declaring svc type:'" << j << "' failed." << endmsg;
333 return StatusCode::FAILURE;
334 }
335 }
336
337 //--------------------------------------------------------------------------
338 // Declare other Services and Algorithms by loading DLL's
339 sc = decodeDllNameList();
340 if ( sc.isFailure() ) {
341 log << MSG::ERROR << "Failure loading declared DLL's" << endmsg;
342 return sc;
343 }
344
345 //--------------------------------------------------------------------------
346 // Deal with the services explicitly declared by the user.
347 sc = decodeExtSvcNameList();
348 if ( sc.isFailure() ) {
349 log << MSG::ERROR << "Failure during external service association" << endmsg;
350 return sc;
351 }
352
353 sc = decodeCreateSvcNameList();
354 if ( sc.isFailure() ) {
355 log << MSG::ERROR << "Failure during external service creation" << endmsg;
356 return sc;
357 }
358
359 //--------------------------------------------------------------------------
360 // Retrieve intrinsic services. If needed configure them.
361 //--------------------------------------------------------------------------
362 const Gaudi::Utils::TypeNameString evtloop_item( m_eventLoopMgr );
363 sc = svcManager()->addService( evtloop_item, ServiceManager::DEFAULT_SVC_PRIORITY * 10 );
364 if ( !sc.isSuccess() ) {
365 log << MSG::FATAL << "Error adding :" << m_eventLoopMgr << endmsg;
366 return sc;
367 } else {
368 ON_VERBOSE
369 log << MSG::VERBOSE << "added service " << evtloop_item << endmsg;
370 }
371
372 m_runable = m_svcLocator->service( m_runableType );
373 if ( !m_runable ) {
374 log << MSG::FATAL << "Error retrieving Runable: " << m_runableType.value() << "\n Check option ApplicationMgr."
375 << m_runableType.name() << endmsg;
376 return sc;
377 }
378 m_processingMgr = m_svcLocator->service( evtloop_item );
379 if ( !m_processingMgr ) {
380 log << MSG::FATAL << "Error retrieving Processing manager: " << m_eventLoopMgr.value()
381 << "\n Check option ApplicationMgr." << m_eventLoopMgr.name() << "\n No events will be processed." << endmsg;
382 return sc;
383 }
384 // The IEventProcessor might also be an IAsyncEventProcessor
385 m_asyncProcessor = m_processingMgr;
386
387 // Establish Update Handlers for ExtSvc and DLLs Properties
388 m_extSvcNameList.declareUpdateHandler( &ApplicationMgr::extSvcNameListHandler, this );
389 m_createSvcNameList.declareUpdateHandler( &ApplicationMgr::createSvcNameListHandler, this );
390 m_dllNameList.declareUpdateHandler( &ApplicationMgr::dllNameListHandler, this );
391
392 if ( m_actHistory ) {
393 // Create HistorySvc with a priority to ensure it's initialized last, finalized first
394 sc = svcManager()->addService( "HistorySvc", std::numeric_limits<int>::max() );
395 if ( sc.isFailure() ) {
396 log << MSG::FATAL << "Error adding HistorySvc" << endmsg;
397 return StatusCode::FAILURE;
398 }
399 }
400
401 log << MSG::INFO << "Application Manager Configured successfully" << endmsg;
402 m_state = m_targetState;
403 return StatusCode::SUCCESS;
404 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:369
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_propertiesPrint
Gaudi::Property< bool > m_propertiesPrint
Definition: ApplicationMgr.h:276
std::string::empty
T empty(T... args)
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:997
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:280
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyHolder.h:264
System::setEnv
GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite=1)
Set an environment variables.
Definition: System.cpp:482
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
ApplicationMgr::m_codeCheck
Gaudi::Property< bool > m_codeCheck
Definition: ApplicationMgr.h:240
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:211
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
MSG::DEBUG
Definition: IMessageSvc.h:15
std::endl
T endl(T... args)
Gaudi::Time::current
static Time current()
Returns the current time.
Definition: Time.cpp:109
ApplicationMgr::m_environment
Gaudi::Property< std::map< std::string, std::string > > m_environment
Definition: ApplicationMgr.h:259
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::m_appVersion
Gaudi::Property< std::string > m_appVersion
Definition: ApplicationMgr.h:238
StatusCode::enableChecking
static GAUDI_API void enableChecking()
Definition: StatusCode.cpp:42
MSG::VERBOSE
Definition: IMessageSvc.h:15
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
ApplicationMgr::createSvcNameListHandler
void createSvcNameListHandler(Gaudi::Details::PropertyBase &)
Definition: ApplicationMgr.cpp:916
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:233
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:15
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
MSG::Level
Level
Definition: IMessageSvc.h:15
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:236
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
ApplicationMgr::extSvcNameListHandler
void extSvcNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:949
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:173
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IJobOptionsSvc::setMyProperties
virtual StatusCode setMyProperties(const std::string &client, IProperty *me)=0
Override default properties of the calling client.
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:221
ApplicationMgr::dllNameListHandler
void dllNameListHandler(Gaudi::Details::PropertyBase &theProp)
Definition: ApplicationMgr.cpp:988
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:232
MSG::NIL
Definition: IMessageSvc.h:15
ApplicationMgr::m_asyncProcessor
SmartIF< IAsyncEventProcessor > m_asyncProcessor
Reference to an asynchronous processing manager object.
Definition: ApplicationMgr.h:215
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
ApplicationMgr::m_svcOptMapping
Gaudi::Property< std::vector< std::string > > m_svcOptMapping
Definition: ApplicationMgr.h:207
ApplicationMgr::m_svcMapping
Gaudi::Property< std::vector< std::string > > m_svcMapping
Definition: ApplicationMgr.h:206
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:225
ApplicationMgr::m_actHistory
Gaudi::Property< bool > m_actHistory
Definition: ApplicationMgr.h:239
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:959
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:303
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:252
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:251
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:51
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:925
std::string::c_str
T c_str(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::i_startup
StatusCode i_startup()
Internal startup routine.
Definition: ApplicationMgr.cpp:111
MSG::ERROR
Definition: IMessageSvc.h:15
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:44
ON_VERBOSE
#define ON_VERBOSE
Definition: ApplicationMgr.cpp:36
MSG::WARNING
Definition: IMessageSvc.h:15
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::getProperties
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
Definition: PropertyHolder.h:251
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
ApplicationMgr::m_appName
Gaudi::Property< std::string > m_appName
Definition: ApplicationMgr.h:237
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
MSG::INFO
Definition: IMessageSvc.h:15
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
MSG::ALWAYS
Definition: IMessageSvc.h:15
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IMessageSvc::setOutputLevel
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.
Gaudi.Configuration.log
log
Definition: Configuration.py:13
std::numeric_limits

## ◆ createEventContext()

EventContext ApplicationMgr::createEventContext | ( |  | ) |
| override

implementation of IEventProcessor::createEventContext()

Definition at line 810 of file ApplicationMgr.cpp.

810 {
811 if ( m_state == Gaudi::StateMachine::RUNNING ) {
812 if ( m_processingMgr ) { return m_processingMgr->createEventContext(); }
813 }
814 std::stringstream ss;
815 ss << "createEventContext: Invalid state \"" << FSMState() << '"';
816 throw GaudiException( ss.str(), name(), StatusCode::FAILURE );
817 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
std::stringstream
STL class.
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
std::stringstream::str
T str(T... args)
IEventProcessor::createEventContext
virtual EventContext createEventContext()=0
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:849
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846

## ◆ createSvcNameListHandler()

void ApplicationMgr::createSvcNameListHandler | ( | Gaudi::Details::PropertyBase & |  | ) |

Definition at line 916 of file ApplicationMgr.cpp.

916 {
917 if ( !( decodeCreateSvcNameList() ).isSuccess() ) {
918 throw GaudiException( "Failed to create ext services", "MinimalEventLoopMgr::createSvcNameListHandler",
919 StatusCode::FAILURE );
920 }
921 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
ApplicationMgr::decodeCreateSvcNameList
StatusCode decodeCreateSvcNameList()
Definition: ApplicationMgr.cpp:925
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ decodeCreateSvcNameList()

StatusCode ApplicationMgr::decodeCreateSvcNameList | ( |  | ) |

Definition at line 925 of file ApplicationMgr.cpp.

925 {
926 StatusCode result = StatusCode::SUCCESS;
927 const auto& theNames = m_createSvcNameList.value();
928 auto it = theNames.begin();
929 auto et = theNames.end();
930 while ( result.isSuccess() && it != et ) {
931 Gaudi::Utils::TypeNameString item( *it++ );
932 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
933 MsgStream log( m_messageSvc, m_name );
934 log << MSG::ERROR << "decodeCreateSvcNameList: Cannot create service " << item.type() << "/" << item.name()
935 << endmsg;
936 } else {
937 ON_DEBUG {
938 MsgStream log( m_messageSvc, m_name );
939 log << MSG::DEBUG << "decodeCreateSvcNameList: Created service " << item.type() << "/" << item.name() << endmsg;
940 }
941 }
942 }
943 return result;
944 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MSG::DEBUG
Definition: IMessageSvc.h:15
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:35
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
ApplicationMgr::m_createSvcNameList
Gaudi::Property< std::vector< std::string > > m_createSvcNameList
Definition: ApplicationMgr.h:251
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:202
MSG::ERROR
Definition: IMessageSvc.h:15
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ decodeDllNameList()

StatusCode ApplicationMgr::decodeDllNameList | ( |  | ) |

Definition at line 997 of file ApplicationMgr.cpp.

997 {
998
999 MsgStream log( m_messageSvc, m_name );
1000 StatusCode result = StatusCode::SUCCESS;
1001
1002 // Clean up multiple entries from DLL list
1003 // -------------------------------------------------------------------------
1004 std::vector<std::string> newList;
1005 std::map<std::string, unsigned int> dllInList, duplicateList;
1006 {
1007 for ( const auto it : m_dllNameList ) {
1008 if ( 0 == dllInList[it] ) {
1009 newList.push_back( it ); // first instance of this module
1010 } else {
1011 ++duplicateList[it];
1012 } // module listed multiple times
1013 ++dllInList[it]; // increment count for this module
1014 }
1015 }
1016 // m_dllNameList = newList; // update primary list to new, filtered list (do not use the
1017 // property itself otherwise we get called again infinitely)
1018 // List modules that were in there twice..
1019 ON_DEBUG if ( !duplicateList.empty() ) {
1020 log << MSG::DEBUG << "Removed duplicate entries for modules : ";
1021 for ( auto it = duplicateList.begin(); it != duplicateList.end(); ++it ) {
1022 log << it->first << "(" << 1 + it->second << ")";
1023 if ( it != --duplicateList.end() ) log << ", ";
1024 }
1025 log << endmsg;
1026 }
1027 // -------------------------------------------------------------------------
1028
1029 const std::vector<std::string>& theNames = newList;
1030
1031 // only load the new dlls or previously failed dlls
1032 ON_DEBUG log << MSG::DEBUG << "Loading declared DLL's" << endmsg;
1033
1034 std::vector<std::string> successNames, failNames;
1035 for ( const auto& it : theNames ) {
1036 if ( std::find( m_okDlls.rbegin(), m_okDlls.rend(), it ) == m_okDlls.rend() ) {
1037 // found a new module name
1038 StatusCode status = m_classManager->loadModule( it );
1039 if ( status.isFailure() ) {
1040 failNames.push_back( it );
1041 result = StatusCode::FAILURE;
1042 } else {
1043 successNames.push_back( it );
1044 }
1045 }
1046 }
1047
1048 // report back to the user and store the names of the succesfully loaded dlls
1049 if ( !successNames.empty() ) {
1050 log << MSG::INFO << "Successfully loaded modules : ";
1051 for ( auto it = successNames.begin(); it != successNames.end(); it++ ) {
1052 log << ( *it );
1053 if ( ( it + 1 ) != successNames.end() ) log << ", ";
1054 // save name
1055 m_okDlls.push_back( *it );
1056 }
1057 log << endmsg;
1058 }
1059
1060 if ( result == StatusCode::FAILURE ) {
1061 log << MSG::WARNING << "Failed to load modules: ";
1062 for ( auto it = failNames.begin(); it != failNames.end(); it++ ) {
1063 log << ( *it );
1064 if ( ( it + 1 ) != failNames.end() ) log << ", ";
1065 }
1066 log << endmsg;
1067 }
1068 return result;
1069 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::map::empty
T empty(T... args)
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:30
std::vector::rend
T rend(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::map::end
T end(T... args)
ApplicationMgr::m_okDlls
std::vector< std::string > m_okDlls
names of successfully loaded dlls
Definition: ApplicationMgr.h:290
std::map< std::string, unsigned int >
std::vector::push_back
T push_back(T... args)
ON_DEBUG
#define ON_DEBUG
Definition: ApplicationMgr.cpp:35
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::m_dllNameList
Gaudi::Property< std::vector< std::string > > m_dllNameList
Definition: ApplicationMgr.h:225
std::find
T find(T... args)
std::vector< std::string >
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:175
std::map::begin
T begin(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:202
MSG::WARNING
Definition: IMessageSvc.h:15
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
MSG::INFO
Definition: IMessageSvc.h:15
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13
std::vector::rbegin
T rbegin(T... args)

## ◆ decodeExtSvcNameList()

StatusCode ApplicationMgr::decodeExtSvcNameList | ( |  | ) |

Definition at line 959 of file ApplicationMgr.cpp.

959 {
960 StatusCode result = StatusCode::SUCCESS;
961
962 const auto& theNames = m_extSvcNameList.value();
963
964 auto it = theNames.begin();
965 auto et = theNames.end();
966 while ( result.isSuccess() && it != et ) {
967 Gaudi::Utils::TypeNameString item( *it++ );
968 if ( m_extSvcCreates ) {
969 if ( ( result = svcManager()->addService( item, ServiceManager::DEFAULT_SVC_PRIORITY ) ).isFailure() ) {
970 MsgStream log( m_messageSvc, m_name );
971 log << MSG::ERROR << "decodeExtSvcNameList: Cannot create service " << item.type() << "/" << item.name()
972 << endmsg;
973 }
974 } else {
975 if ( ( result = svcManager()->declareSvcType( item.name(), item.type() ) ).isFailure() ) {
976 MsgStream log( m_messageSvc, m_name );
977 log << MSG::ERROR << "decodeExtSvcNameList: Cannot declare service " << item.type() << "/" << item.name()
978 << endmsg;
979 }
980 }
981 }
982 return result;
983 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::m_extSvcNameList
Gaudi::Property< std::vector< std::string > > m_extSvcNameList
Definition: ApplicationMgr.h:221
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
ApplicationMgr::m_extSvcCreates
Gaudi::Property< bool > m_extSvcCreates
Definition: ApplicationMgr.h:222
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:202
MSG::ERROR
Definition: IMessageSvc.h:15
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ dllNameListHandler()

void ApplicationMgr::dllNameListHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 988 of file ApplicationMgr.cpp.

988 {
989 if ( !( decodeDllNameList() ).isSuccess() ) {
990 throw GaudiException( "Failed to load DLLs.", "MinimalEventLoopMgr::dllNameListHandler", StatusCode::FAILURE );
991 }
992 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
ApplicationMgr::decodeDllNameList
StatusCode decodeDllNameList()
Definition: ApplicationMgr.cpp:997
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ evtLoopPropertyHandler()

void ApplicationMgr::evtLoopPropertyHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 906 of file ApplicationMgr.cpp.

906 {
907 if ( m_processingMgr ) {
908 auto props = m_processingMgr.as<IProperty>();
909 if ( props ) props->setProperty( p ).ignore();
910 }
911 }
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20

## ◆ executeEvent()

StatusCode ApplicationMgr::executeEvent | ( | EventContext && | ctx | ) |
| override

implementation of IEventProcessor::executeEvent(void*)

Definition at line 787 of file ApplicationMgr.cpp.

787 {
788 if ( m_state == Gaudi::StateMachine::RUNNING ) {
789 if ( m_processingMgr ) { return m_processingMgr->executeEvent( std::move( ctx ) ); }
790 }
791 MsgStream log( m_messageSvc, name() );
792 log << MSG::FATAL << "executeEvent: Invalid state \"" << FSMState() << "\"" << endmsg;
793 return StatusCode::FAILURE;
794 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
IEventProcessor::executeEvent
virtual StatusCode executeEvent(EventContext &&ctx)=0
Process single event.
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
MSG::FATAL
Definition: IMessageSvc.h:15
std::move
T move(T... args)
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:849
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ executeRun()

StatusCode ApplicationMgr::executeRun | ( | int | evtmax | ) |
| override

implementation of IEventProcessor::executeRun(int)

Definition at line 821 of file ApplicationMgr.cpp.

821 {
822 MsgStream log( m_messageSvc, name() );
823 if ( m_state == Gaudi::StateMachine::RUNNING ) {
824 if ( m_processingMgr ) { return m_processingMgr->executeRun( evtmax ); }
825 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
826 return StatusCode::SUCCESS;
827 }
828 log << MSG::FATAL << "executeRun: Invalid state \"" << FSMState() << "\"" << endmsg;
829 return StatusCode::FAILURE;
830 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
MSG::FATAL
Definition: IMessageSvc.h:15
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::WARNING
Definition: IMessageSvc.h:15
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:849
IEventProcessor::executeRun
virtual StatusCode executeRun(int maxevt)=0
Process the maxevt events as a Run.
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ extSvcNameListHandler()

void ApplicationMgr::extSvcNameListHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

Definition at line 949 of file ApplicationMgr.cpp.

949 {
950 if ( !( decodeExtSvcNameList() ).isSuccess() ) {
951 throw GaudiException( "Failed to declare ext services", "MinimalEventLoopMgr::extSvcNameListHandler",
952 StatusCode::FAILURE );
953 }
954 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
ApplicationMgr::decodeExtSvcNameList
StatusCode decodeExtSvcNameList()
Definition: ApplicationMgr.cpp:959
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ finalize()

StatusCode ApplicationMgr::finalize | ( |  | ) |
| override

Definition at line 572 of file ApplicationMgr.cpp.

572 {
573 MsgStream log( m_messageSvc, name() );
574 if ( m_state == Gaudi::StateMachine::CONFIGURED ) {
575 log << MSG::INFO << "Already Finalized" << endmsg;
576 return StatusCode::SUCCESS;
577 }
578 if ( m_state != Gaudi::StateMachine::INITIALIZED ) {
579 log << MSG::FATAL << "finalize: Invalid state \"" << m_state << "\"" << endmsg;
580 return StatusCode::FAILURE;
581 }
582 m_targetState = Gaudi::StateMachine::CONFIGURED;
583
584 // disable message suppression in finalize
585 m_svcLocator->service<IProperty>( "MessageSvc" )
586 ->setProperty( Gaudi::Property<bool>( "enableSuppression", false ) )
587 .ignore();
588
589 // Finalize independently managed Algorithms
590 StatusCode sc = algManager()->finalize();
591 if ( sc.isFailure() ) {
592 log << MSG::WARNING << "Failed to finalize an algorithm." << endmsg;
593 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
594 }
595
596 // Finalize all Services
597 sc = svcManager()->finalize();
598 if ( sc.isFailure() ) {
599 log << MSG::WARNING << "Failed to finalize a service." << endmsg;
600 m_returnCode = Gaudi::ReturnCode::FinalizationFailure;
601 }
602
603 // svcManager()->removeService( (IService*) m_processingMgr.get() );
604 // svcManager()->removeService( (IService*) m_runable.get() );
605
606 if ( m_codeCheck ) { StatusCode::disableChecking(); }
607
608 if ( sc.isSuccess() ) {
609 log << MSG::INFO << "Application Manager Finalized successfully" << endmsg;
610 } else {
611 log << MSG::ERROR << "Application Manager failed to finalize" << endmsg;
612 }
613
614 m_state = m_targetState;
615 return sc;
616 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204
Gaudi::ReturnCode::FinalizationFailure
constexpr int FinalizationFailure
Error codes for operation failures.
Definition: AppReturnCode.h:32
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:280
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
ApplicationMgr::m_codeCheck
Gaudi::Property< bool > m_codeCheck
Definition: ApplicationMgr.h:240
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
PropertyHolder< CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:145
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
MSG::FATAL
Definition: IMessageSvc.h:15
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:173
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
IStateful::finalize
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::ERROR
Definition: IMessageSvc.h:15
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:44
MSG::WARNING
Definition: IMessageSvc.h:15
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
MSG::INFO
Definition: IMessageSvc.h:15
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ FSMState()

Gaudi::StateMachine::State ApplicationMgr::FSMState | ( |  | ) | const
| override

Definition at line 849 of file ApplicationMgr.cpp.

849 { return m_state; }
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203

## ◆ getManager()

template<class I >

SmartIF<IComponentManager>& ApplicationMgr::getManager | ( |  | ) |
| inline

Definition at line 118 of file ApplicationMgr.h.

118 {
119 return m_managers[I::interfaceID().id()];
120 }
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:162

## ◆ GoToState()

StatusCode ApplicationMgr::GoToState | ( | Gaudi::StateMachine::State | state,
|  | bool | ignoreFailures = `false`
| ) |  |
| protected

Reach a state from current state (whichever it is) going through the correct transitions.

By default, if a transition fails, the chain is interrupted, but the behavior can be changed with the parameter "gnoreFailures"

Definition at line 675 of file ApplicationMgr.cpp.

675 {
676 StatusCode sc = StatusCode( StatusCode::SUCCESS, true );
677
678 switch ( state ) {
679
680 case Gaudi::StateMachine::OFFLINE:
681 switch ( m_state ) {
682 case Gaudi::StateMachine::OFFLINE:
683 return StatusCode::SUCCESS;
684 break;
685 case Gaudi::StateMachine::CONFIGURED:
686 return terminate();
687 break;
688 default: // Gaudi::StateMachine::INITIALIZED or Gaudi::StateMachine::RUNNING
689 sc = GoToState( Gaudi::StateMachine::CONFIGURED );
690 if ( sc.isSuccess() ) { return terminate(); }
691 break;
692 }
693 break;
694
695 case Gaudi::StateMachine::CONFIGURED:
696 switch ( m_state ) {
697 case Gaudi::StateMachine::CONFIGURED:
698 return StatusCode::SUCCESS;
699 break;
700 case Gaudi::StateMachine::OFFLINE:
701 return configure();
702 break;
703 case Gaudi::StateMachine::INITIALIZED:
704 return finalize();
705 break;
706 default: // Gaudi::StateMachine::RUNNING
707 sc = GoToState( Gaudi::StateMachine::INITIALIZED );
708 if ( sc.isSuccess() ) { return finalize(); }
709 break;
710 }
711 break;
712
713 case Gaudi::StateMachine::INITIALIZED:
714 switch ( m_state ) {
715 case Gaudi::StateMachine::INITIALIZED:
716 return StatusCode::SUCCESS;
717 break;
718 case Gaudi::StateMachine::CONFIGURED:
719 return initialize();
720 break;
721 case Gaudi::StateMachine::RUNNING:
722 return stop();
723 break;
724 default: // Gaudi::StateMachine::OFFLINE
725 sc = GoToState( Gaudi::StateMachine::CONFIGURED );
726 if ( sc.isSuccess() ) { return initialize(); }
727 break;
728 }
729 break;
730
731 case Gaudi::StateMachine::RUNNING:
732 switch ( m_state ) {
733 case Gaudi::StateMachine::RUNNING:
734 return StatusCode::SUCCESS;
735 break;
736 case Gaudi::StateMachine::INITIALIZED:
737 return start();
738 break;
739 default: // Gaudi::StateMachine::OFFLINE or Gaudi::StateMachine::CONFIGURED
740 sc = GoToState( Gaudi::StateMachine::INITIALIZED );
741 if ( sc.isSuccess() ) { return start(); }
742 break;
743 }
744 break;
745 }
746
747 // If I get here, there has been a problem in the recursion
748
749 if ( ignoreFailures ) {
750 // force the new state
751 m_state = state;
752 return StatusCode::SUCCESS;
753 }
754
755 return sc;
756 }
ApplicationMgr::initialize
StatusCode initialize() override
Definition: ApplicationMgr.cpp:409
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::terminate
StatusCode terminate() override
Definition: ApplicationMgr.cpp:621
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:675
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
ApplicationMgr::finalize
StatusCode finalize() override
Definition: ApplicationMgr.cpp:572
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
ApplicationMgr::start
StatusCode start() override
Definition: ApplicationMgr.cpp:470
ApplicationMgr::configure
StatusCode configure() override
Definition: ApplicationMgr.cpp:221
ApplicationMgr::stop
StatusCode stop() override
Definition: ApplicationMgr.cpp:529
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13

## ◆ i_startup()

StatusCode ApplicationMgr::i_startup | ( |  | ) |
| protected

Internal startup routine.

Definition at line 111 of file ApplicationMgr.cpp.

111 {
112
113 StatusCode sc;
114
115 // declare factories in current module
116 m_classManager->loadModule( "" ).ignore();
117
118 // Note: we cannot use CommonMessaging methods here because MessageSvc is not there yet
119 MsgStream log( nullptr, name() );
120
121 // Create the Message service
122 auto msgsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "MessageSvc", m_messageSvcType ) );
123 if ( !msgsvc ) {
124 log << MSG::FATAL << "Error creating MessageSvc of type " << m_messageSvcType << endmsg;
125 return StatusCode::FAILURE;
126 }
127 // Get the useful interface from Message services
128 m_messageSvc = m_svcLocator->service( "MessageSvc" );
129 if ( !m_messageSvc ) {
130 log << MSG::FATAL << "Error retrieving MessageSvc." << endmsg;
131 return StatusCode::FAILURE;
132 }
133
134 auto jobsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "JobOptionsSvc", m_jobOptionsSvcType ) );
135 // Create the Job Options service
136 if ( !jobsvc ) {
137 log << MSG::FATAL << "Error creating JobOptionsSvc" << endmsg;
138 return StatusCode::FAILURE;
139 }
140 // Get the useful interface from Message services
141 m_jobOptionsSvc = m_svcLocator->service( "JobOptionsSvc" );
142 if ( !m_jobOptionsSvc ) {
143 log << MSG::FATAL << "Error retrieving JobOptionsSvc." << endmsg;
144 return StatusCode::FAILURE;
145 }
146
147 auto jobOptsIProp = jobsvc.as<IProperty>();
148 if ( !jobOptsIProp ) {
149 log << MSG::FATAL << "Error locating JobOptionsSvc" << endmsg;
150 return StatusCode::FAILURE;
151 }
152 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "TYPE", m_jobOptionsType ) );
153 if ( !sc.isSuccess() ) {
154 log << MSG::FATAL << "Error setting TYPE option in JobOptionsSvc" << endmsg;
155 return sc;
156 }
157
158 if ( !m_jobOptionsPreAction.empty() ) {
159 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONPARAMS", m_jobOptionsPreAction ) );
160 if ( !sc.isSuccess() ) {
161 log << MSG::FATAL << "Error setting JobOptionsPreAction option in JobOptionsSvc" << endmsg;
162 return sc;
163 }
164 }
165
166 if ( !m_jobOptionsPostAction.empty() ) {
167 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PYTHONACTION", m_jobOptionsPostAction ) );
168 if ( !sc.isSuccess() ) {
169 log << MSG::FATAL << "Error setting JobOptionsPostAction option in JobOptionsSvc" << endmsg;
170 return sc;
171 }
172 }
173
174 if ( !m_jobOptionsPath.empty() ) { // The command line takes precedence
175 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", m_jobOptionsPath ) );
176 if ( !sc.isSuccess() ) {
177 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc" << endmsg;
178 return sc;
179 }
180 } else if ( isEnvSet( "JOBOPTPATH" ) ) { // Otherwise the Environment JOBOPTPATH
181 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", getEnv( "JOBOPTPATH" ) ) );
182 if ( !sc.isSuccess() ) {
183 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc from env" << endmsg;
184 return sc;
185 }
186 } else { // Otherwise the default
187 sc = jobOptsIProp->setProperty( Gaudi::Property<std::string>( "PATH", "../options/job.opts" ) );
188 if ( !sc.isSuccess() ) {
189 log << MSG::FATAL << "Error setting PATH option in JobOptionsSvc to default" << endmsg;
190 return sc;
191 }
192 }
193 jobOptsIProp.reset();
194
195 // Sets my default the Output Level of the Message service to be
196 // the same as this
197 auto msgSvcIProp = msgsvc.as<IProperty>();
198 msgSvcIProp->setProperty( Gaudi::Property<int>( "OutputLevel", m_outputLevel ) ).ignore();
199 msgSvcIProp.reset();
200
201 sc = jobsvc->sysInitialize();
202 if ( !sc.isSuccess() ) {
203 log << MSG::FATAL << "Error initializing JobOptionsSvc" << endmsg;
204 return sc;
205 }
206 sc = msgsvc->sysInitialize();
207 if ( !sc.isSuccess() ) {
208 log << MSG::FATAL << "Error initializing MessageSvc" << endmsg;
209 return sc;
210 }
211
212 // Make sure output level caches are up to date.
213 outputLevelUpdate();
214
215 return sc;
216 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:369
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DLLClassManager::loadModule
StatusCode loadModule(const std::string &module, bool fireIncident=true) override
Definition: DLLClassManager.cpp:30
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
ApplicationMgr::m_jobOptionsType
Gaudi::Property< std::string > m_jobOptionsType
Definition: ApplicationMgr.h:226
ApplicationMgr::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ApplicationMgr.cpp:1071
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
MSG::FATAL
Definition: IMessageSvc.h:15
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
ApplicationMgr::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: ApplicationMgr.h:236
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:173
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ISvcManager::createService
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)=0
Creates and instance of a service type that has been declared beforehand and assigns it a name.
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
ApplicationMgr::m_jobOptionsPreAction
Gaudi::Property< std::string > m_jobOptionsPreAction
Definition: ApplicationMgr.h:228
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:389
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:175
ApplicationMgr::m_jobOptionsSvcType
Gaudi::Property< std::string > m_jobOptionsSvcType
Definition: ApplicationMgr.h:200
ApplicationMgr::m_jobOptionsPostAction
Gaudi::Property< std::string > m_jobOptionsPostAction
Definition: ApplicationMgr.h:230
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_messageSvcType
Gaudi::Property< std::string > m_messageSvcType
Definition: ApplicationMgr.h:199
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
ApplicationMgr::m_jobOptionsPath
Gaudi::Property< std::string > m_jobOptionsPath
Definition: ApplicationMgr.h:227
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ initialize()

StatusCode ApplicationMgr::initialize | ( |  | ) |
| override

Definition at line 409 of file ApplicationMgr.cpp.

409 {
410 StatusCode sc;
411
412 MsgStream log( m_messageSvc, name() );
413
414 // Make sure output level caches are up to date.
415 outputLevelUpdate();
416
417 // I cannot add these services in configure() because they are coming from GaudiUtils
418 // and it messes up genconf when rebuilding it.
419 if ( m_stopOnSignal ) {
420 // Instantiate the service that schedules a stop when a signal is received
421 std::string svcname( "Gaudi::Utils::StopSignalHandler" );
422 sc = svcManager()->addService( svcname );
423 if ( sc.isFailure() ) {
424 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
425 }
426 }
427
428 if ( m_stalledEventMonitoring ) {
429 // Instantiate the service that schedules a stop when a signal is received
430 std::string svcname( "StalledEventMonitor" );
431 sc = svcManager()->addService( svcname );
432 if ( sc.isFailure() ) {
433 log << MSG::INFO << "Cannot instantiate " << svcname << "signals will be ignored" << endmsg;
434 }
435 }
436
437 if ( m_state == Gaudi::StateMachine::INITIALIZED ) {
438 log << MSG::INFO << "Already Initialized!" << endmsg;
439 return StatusCode::SUCCESS;
440 }
441 if ( m_state != Gaudi::StateMachine::CONFIGURED ) {
442 log << MSG::FATAL << "initialize: Invalid state \"" << m_state << "\"" << endmsg;
443 return StatusCode::FAILURE;
444 }
445 m_targetState = Gaudi::StateMachine::INITIALIZED;
446
447 //--------------------------------------------------------------------------
448 // Initialize the list of top Services
449 //--------------------------------------------------------------------------
450 sc = svcManager()->initialize();
451 if ( !sc.isSuccess() ) return sc;
452
453 sc = algManager()->initialize();
454 if ( !sc.isSuccess() ) return sc;
455
456 //--------------------------------------------------------------------------
457 // Final steps: Inform user and change internal state
458 //--------------------------------------------------------------------------
459 log << MSG::INFO << "Application Manager Initialized successfully" << endmsg;
460 m_state = m_targetState;
461
462 if ( m_printAlgsSequence ) printAlgsSequences();
463
464 return sc;
465 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
ApplicationMgr::m_printAlgsSequence
Gaudi::Property< bool > m_printAlgsSequence
Definition: ApplicationMgr.h:283
ApplicationMgr::m_stopOnSignal
Gaudi::Property< bool > m_stopOnSignal
Property to enable/disable the "stop on signal" service.
Definition: ApplicationMgr.h:268
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ApplicationMgr.cpp:1071
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:15
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::m_stalledEventMonitoring
Gaudi::Property< bool > m_stalledEventMonitoring
Property to enable/disable the monitoring and reporting of stalled events.
Definition: ApplicationMgr.h:273
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
IStateful::initialize
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
ApplicationMgr::printAlgsSequences
void printAlgsSequences()
Print the sequence of algorithms that have been loaded.
Definition: ApplicationMgr.cpp:1097
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
MSG::INFO
Definition: IMessageSvc.h:15
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ name()

const std::string & ApplicationMgr::name | ( |  | ) | const
| override

Definition at line 846 of file ApplicationMgr.cpp.

846 { return m_name; }
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:202

## ◆ nextEvent()

StatusCode ApplicationMgr::nextEvent | ( | int | maxevt | ) |
| override

Definition at line 512 of file ApplicationMgr.cpp.

512 {
513 if ( m_state != Gaudi::StateMachine::RUNNING ) {
514 MsgStream log( m_messageSvc, name() );
515 log << MSG::FATAL << "nextEvent: Invalid state \"" << m_state << "\"" << endmsg;
516 return StatusCode::FAILURE;
517 }
518 if ( !m_processingMgr ) {
519 MsgStream log( m_messageSvc, name() );
520 log << MSG::FATAL << "No event processing manager specified. Check option: " << m_eventLoopMgr.name() << endmsg;
521 return StatusCode::FAILURE;
522 }
523 return m_processingMgr->nextEvent( maxevt );
524 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
ApplicationMgr::m_eventLoopMgr
Gaudi::Property< std::string > m_eventLoopMgr
Definition: ApplicationMgr.h:233
IEventProcessor::nextEvent
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
MSG::FATAL
Definition: IMessageSvc.h:15
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
maxevt
int maxevt
Definition: Bootstrap.cpp:260
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ outputLevelUpdate()

void ApplicationMgr::outputLevelUpdate | ( |  | ) |
| override

Function to call to update the outputLevel of the components (after a change in MessageSvc).

Definition at line 1071 of file ApplicationMgr.cpp.

1071 {
1072 resetMessaging();
1073 for ( auto& mgrItem : m_managers ) { mgrItem.second->outputLevelUpdate(); }
1074 }
ApplicationMgr::m_managers
ManagersMap m_managers
Map of known component managers.
Definition: ApplicationMgr.h:162
CommonMessaging< implements< IAppMgrUI, Gaudi::Interfaces::IAsyncEventProcessor, IService, IStateful, INamedInterface, IProperty > >::resetMessaging
MSG::Level resetMessaging()
Reinitialize internal states.
Definition: CommonMessaging.h:174

## ◆ pluginDebugPropertyHandler()

void ApplicationMgr::pluginDebugPropertyHandler | ( | Gaudi::Details::PropertyBase & | theProp | ) |

## ◆ printAlgsSequences()

void ApplicationMgr::printAlgsSequences | ( |  | ) |

Print the sequence of algorithms that have been loaded.

Definition at line 1097 of file ApplicationMgr.cpp.

1097 {
1098 MsgStream log( m_messageSvc, m_name );
1099 log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
1100 for ( auto& algname : m_topAlgNameList ) { printAlgsSequencesHelper( algManager(), algname, log, 0 ); }
1101 log << MSG::ALWAYS << "******************************************************************************" << endmsg;
1102 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_topAlgNameList
Gaudi::Property< std::vector< std::string > > m_topAlgNameList
Definition: ApplicationMgr.h:192
ApplicationMgr::m_name
std::string m_name
Name.
Definition: ApplicationMgr.h:202
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
MSG::ALWAYS
Definition: IMessageSvc.h:15
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ queryInterface()

StatusCode ApplicationMgr::queryInterface | ( | const InterfaceID & | iid,
|  | void ** | pinterface
| ) |  |
| override

Definition at line 85 of file ApplicationMgr.cpp.

85 {
86 if ( !ppvi ) { return StatusCode::FAILURE; }
87
88 // try to find own/direct interfaces:
89 StatusCode sc = base_class::queryInterface( iid, ppvi );
90 if ( sc.isSuccess() ) return sc;
91
92 // find indirect interfaces :
93 if ( ISvcLocator::interfaceID().versionMatch( iid ) ) { return serviceLocator()->queryInterface( iid, ppvi ); }
94 if ( ISvcManager::interfaceID().versionMatch( iid ) ) { return svcManager()->queryInterface( iid, ppvi ); }
95 if ( IAlgManager::interfaceID().versionMatch( iid ) ) { return algManager()->queryInterface( iid, ppvi ); }
96 if ( IClassManager::interfaceID().versionMatch( iid ) ) { return m_classManager->queryInterface( iid, ppvi ); }
97 if ( IMessageSvc::interfaceID().versionMatch( iid ) ) {
98 *ppvi = m_messageSvc.get();
99 if ( m_messageSvc ) m_messageSvc->addRef();
100 // Note that 0 can be a valid IMessageSvc pointer value (when used for
101 // MsgStream).
102 return StatusCode::SUCCESS;
103 }
104 *ppvi = nullptr;
105 return StatusCode::FAILURE;
106 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
InterfaceID::versionMatch
constexpr bool versionMatch(const InterfaceID &iid) const
check compatibility.
Definition: IInterface.h:55
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Needed to locate the message service.
Definition: ApplicationMgr.h:135
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DLLClassManager::queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
implementation of IInterface::queryInterface
Definition: DLLClassManager.cpp:70
ApplicationMgr::m_classManager
SmartIF< DLLClassManager > m_classManager
Reference to the class manager.
Definition: ApplicationMgr.h:175
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:253
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
IInterface::queryInterface
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.

## ◆ reinitialize()

StatusCode ApplicationMgr::reinitialize | ( |  | ) |
| override

Definition at line 856 of file ApplicationMgr.cpp.

856 {
857 MsgStream log( m_messageSvc, name() );
858 StatusCode retval = StatusCode::SUCCESS;
859 StatusCode sc;
860 if ( m_state < Gaudi::StateMachine::INITIALIZED ) {
861 throw GaudiException( "Cannot reinitialize application if not INITIALIZED or RUNNING",
862 "ApplicationMgr::reinitialize", StatusCode::FAILURE );
863 }
864 if ( m_state == Gaudi::StateMachine::RUNNING ) { retval = GoToState( Gaudi::StateMachine::INITIALIZED ); }
865 sc = svcManager()->reinitialize();
866 if ( sc.isFailure() ) retval = sc;
867 sc = algManager()->reinitialize();
868 if ( sc.isFailure() ) retval = sc;
869
870 sc = m_messageSvc.as<IService>()->sysReinitialize();
871 if ( sc.isFailure() ) retval = sc;
872 sc = m_jobOptionsSvc.as<IService>()->sysReinitialize();
873 if ( sc.isFailure() ) retval = sc;
874
875 log << MSG::INFO << "Application Manager Reinitialized successfully" << endmsg;
876
877 return retval;
878 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
compareRootHistos.retval
def retval
Definition: compareRootHistos.py:458
ApplicationMgr::sysReinitialize
StatusCode sysReinitialize() override
Definition: ApplicationMgr.h:99
IStateful::reinitialize
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:675
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
MSG::INFO
Definition: IMessageSvc.h:15
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ restart()

StatusCode ApplicationMgr::restart | ( |  | ) |
| override

Definition at line 883 of file ApplicationMgr.cpp.

883 {
884 StatusCode retval = StatusCode::SUCCESS;
885 StatusCode sc;
886 if ( m_state != Gaudi::StateMachine::RUNNING ) {
887 throw GaudiException( "Cannot restart application if not RUNNING", "ApplicationMgr::restart", StatusCode::FAILURE );
888 }
889
890 sc = svcManager()->restart();
891 if ( sc.isFailure() ) retval = sc;
892 sc = algManager()->restart();
893 if ( sc.isFailure() ) retval = sc;
894
895 sc = m_messageSvc.as<IService>()->sysRestart();
896 if ( sc.isFailure() ) retval = sc;
897 sc = m_jobOptionsSvc.as<IService>()->sysRestart();
898 if ( sc.isFailure() ) retval = sc;
899
900 return retval;
901 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
ApplicationMgr::sysRestart
StatusCode sysRestart() override
Definition: ApplicationMgr.h:101
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
compareRootHistos.retval
def retval
Definition: compareRootHistos.py:458
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
IStateful::restart
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210

## ◆ run()

StatusCode ApplicationMgr::run | ( |  | ) |
| override

Definition at line 761 of file ApplicationMgr.cpp.

761 {
762 StatusCode sc = StatusCode::SUCCESS;
763
764 sc = GoToState( Gaudi::StateMachine::RUNNING );
765 if ( sc.isSuccess() ) {
766 MsgStream log( m_messageSvc, name() );
767 if ( m_runable != 0 ) { // loop over the events
768 sc = m_runable->run();
769 if ( !sc.isSuccess() ) { log << MSG::FATAL << "Application execution failed. Ending the job." << endmsg; }
770 } else {
771 log << MSG::FATAL << "Application has no runable object. Check option:" << m_runableType.name() << endmsg;
772 }
773 }
774 if ( sc.isSuccess() ) { // try to close cleanly
775 sc = GoToState( Gaudi::StateMachine::OFFLINE );
776 }
777 // either the runable failed of the stut-down
778 if ( sc.isFailure() ) { // try to close anyway (but keep the StatusCode unchanged)
779 GoToState( Gaudi::StateMachine::OFFLINE, true ).ignore();
780 }
781 return sc;
782 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
IRunable::run
virtual StatusCode run()=0
Run the class implementation.
ApplicationMgr::m_runable
SmartIF< IRunable > m_runable
Reference to the runable object.
Definition: ApplicationMgr.h:211
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MSG::FATAL
Definition: IMessageSvc.h:15
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::m_runableType
Gaudi::Property< std::string > m_runableType
Definition: ApplicationMgr.h:232
ApplicationMgr::GoToState
StatusCode GoToState(Gaudi::StateMachine::State state, bool ignoreFailures=false)
Reach a state from current state (whichever it is) going through the correct transitions.
Definition: ApplicationMgr.cpp:675
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ serviceLocator()

SmartIF<ISvcLocator>& ApplicationMgr::serviceLocator | ( |  | ) | const
| inline override

Needed to locate the message service.

Definition at line 135 of file ApplicationMgr.h.

135 { return m_svcLocator; }
ApplicationMgr::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Reference to its own service locator (must be instantiated prior to any service!)
Definition: ApplicationMgr.h:173

## ◆ setServiceManager()

void ApplicationMgr::setServiceManager | ( | ISvcManager * |  | ) |
| inline override protected

Definition at line 145 of file ApplicationMgr.h.

145 {}

## ◆ start()

StatusCode ApplicationMgr::start | ( |  | ) |
| override

Definition at line 470 of file ApplicationMgr.cpp.

470 {
471
472 MsgStream log( m_messageSvc, name() );
473 StatusCode sc;
474
475 if ( m_state == Gaudi::StateMachine::RUNNING ) {
476 log << MSG::INFO << "Already Initialized!" << endmsg;
477 return StatusCode::SUCCESS;
478 }
479 if ( m_state != Gaudi::StateMachine::INITIALIZED ) {
480 log << MSG::FATAL << "start: Invalid state \"" << m_state << "\"" << endmsg;
481 return StatusCode::FAILURE;
482 }
483 m_targetState = Gaudi::StateMachine::RUNNING;
484
485 //--------------------------------------------------------------------------
486 // Initialize the list of top Services
487 //--------------------------------------------------------------------------
488 sc = m_jobOptionsSvc.as<IService>()->sysStart();
489 if ( !sc.isSuccess() ) return sc;
490
491 sc = m_messageSvc.as<IService>()->sysStart();
492 if ( !sc.isSuccess() ) return sc;
493
494 sc = svcManager()->start();
495 if ( !sc.isSuccess() ) return sc;
496
497 sc = algManager()->start();
498 if ( !sc.isSuccess() ) return sc;
499
500 //--------------------------------------------------------------------------
501 // Final steps: Inform user and change internal state
502 //--------------------------------------------------------------------------
503 log << MSG::INFO << "Application Manager Started successfully" << endmsg;
504 m_state = m_targetState;
505
506 return sc;
507 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
ApplicationMgr::sysStart
StatusCode sysStart() override
Definition: ApplicationMgr.h:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
IStateful::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
MSG::FATAL
Definition: IMessageSvc.h:15
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
MSG::INFO
Definition: IMessageSvc.h:15
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ stop()

StatusCode ApplicationMgr::stop | ( |  | ) |
| override

Definition at line 529 of file ApplicationMgr.cpp.

529 {
530
531 MsgStream log( m_messageSvc, name() );
532 StatusCode sc;
533
534 if ( m_state == Gaudi::StateMachine::INITIALIZED ) {
535 log << MSG::INFO << "Already Initialized!" << endmsg;
536 return StatusCode::SUCCESS;
537 }
538 if ( m_state != Gaudi::StateMachine::RUNNING ) {
539 log << MSG::FATAL << "stop: Invalid state \"" << m_state << "\"" << endmsg;
540 return StatusCode::FAILURE;
541 }
542 m_targetState = Gaudi::StateMachine::INITIALIZED;
543
544 // Stop independently managed Algorithms
545 sc = algManager()->stop();
546 if ( !sc.isSuccess() ) return sc;
547
548 //--------------------------------------------------------------------------
549 // Stop the list of top Services
550 //--------------------------------------------------------------------------
551 sc = svcManager()->stop();
552 if ( !sc.isSuccess() ) return sc;
553
554 sc = m_messageSvc.as<IService>()->sysStop();
555 if ( !sc.isSuccess() ) return sc;
556
557 sc = m_jobOptionsSvc.as<IService>()->sysStop();
558 if ( !sc.isSuccess() ) return sc;
559
560 //--------------------------------------------------------------------------
561 // Final steps: Inform user and change internal state
562 //--------------------------------------------------------------------------
563 log << MSG::INFO << "Application Manager Stopped successfully" << endmsg;
564 m_state = m_targetState;
565
566 return sc;
567 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
ApplicationMgr::svcManager
SmartIF< ISvcManager > & svcManager()
Definition: ApplicationMgr.h:122
MSG::FATAL
Definition: IMessageSvc.h:15
IStateful::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ApplicationMgr::sysStop
StatusCode sysStop() override
Definition: ApplicationMgr.h:95
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
MSG::INFO
Definition: IMessageSvc.h:15
ApplicationMgr::algManager
SmartIF< IAlgManager > & algManager()
Definition: ApplicationMgr.h:128
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ stopRun()

StatusCode ApplicationMgr::stopRun | ( |  | ) |
| override

implementation of IEventProcessor::stopRun()

Definition at line 835 of file ApplicationMgr.cpp.

835 {
836 MsgStream log( m_messageSvc, name() );
837 if ( m_state == Gaudi::StateMachine::RUNNING ) {
838 if ( m_processingMgr ) { return m_processingMgr->stopRun(); }
839 log << MSG::WARNING << "No EventLoop Manager specified " << endmsg;
840 return StatusCode::SUCCESS;
841 }
842 log << MSG::FATAL << "stopRun: Invalid state \"" << FSMState() << "\"" << endmsg;
843 return StatusCode::FAILURE;
844 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
IEventProcessor::stopRun
virtual StatusCode stopRun()=0
Schedule a stop of the current event processing.
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ApplicationMgr::m_processingMgr
SmartIF< IEventProcessor > m_processingMgr
Reference to processing manager object.
Definition: ApplicationMgr.h:212
MSG::FATAL
Definition: IMessageSvc.h:15
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::WARNING
Definition: IMessageSvc.h:15
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
ApplicationMgr::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: ApplicationMgr.cpp:849
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ svcManager()

SmartIF<ISvcManager>& ApplicationMgr::svcManager | ( |  | ) |
| inline

Definition at line 122 of file ApplicationMgr.h.

122 {
123 // Cache the casted pointer to ISvcManager
124 if ( !m_svcManager ) { m_svcManager = getManager<IService>(); }
125 return m_svcManager;
126 }
ApplicationMgr::m_svcManager
SmartIF< ISvcManager > m_svcManager
Cached pointer to the manager of services.
Definition: ApplicationMgr.h:167

## ◆ sysFinalize()

StatusCode ApplicationMgr::sysFinalize | ( |  | ) |
| inline override

Definition at line 97 of file ApplicationMgr.h.

97 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ sysInitialize()

StatusCode ApplicationMgr::sysInitialize | ( |  | ) |
| inline override

Definition at line 91 of file ApplicationMgr.h.

91 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ sysReinitialize()

StatusCode ApplicationMgr::sysReinitialize | ( |  | ) |
| inline override

Definition at line 99 of file ApplicationMgr.h.

99 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ sysRestart()

StatusCode ApplicationMgr::sysRestart | ( |  | ) |
| inline override

Definition at line 101 of file ApplicationMgr.h.

101 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ sysStart()

StatusCode ApplicationMgr::sysStart | ( |  | ) |
| inline override

Definition at line 93 of file ApplicationMgr.h.

93 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ sysStop()

StatusCode ApplicationMgr::sysStop | ( |  | ) |
| inline override

Definition at line 95 of file ApplicationMgr.h.

95 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ targetFSMState()

Gaudi::StateMachine::State ApplicationMgr::targetFSMState | ( |  | ) | const
| override

Definition at line 851 of file ApplicationMgr.cpp.

851 { return m_targetState; }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204

## ◆ terminate()

StatusCode ApplicationMgr::terminate | ( |  | ) |
| override

Definition at line 621 of file ApplicationMgr.cpp.

621 {
622 MsgStream log( m_messageSvc, name() );
623
624 if ( m_state == Gaudi::StateMachine::OFFLINE ) {
625 log << MSG::INFO << "Already Offline" << endmsg;
626 return StatusCode::SUCCESS;
627 }
628 if ( m_state != Gaudi::StateMachine::CONFIGURED ) {
629 log << MSG::FATAL << "terminate: Invalid state \"" << m_state << "\"" << endmsg;
630 return StatusCode::FAILURE;
631 }
632 // release all Services
633 m_targetState = Gaudi::StateMachine::OFFLINE;
634
635 if ( m_returnCode.value() == Gaudi::ReturnCode::Success ) {
636 log << MSG::INFO << "Application Manager Terminated successfully" << endmsg;
637 } else if ( m_returnCode.value() == Gaudi::ReturnCode::ScheduledStop ) {
638 log << MSG::INFO << "Application Manager Terminated successfully with a user requested ScheduledStop" << endmsg;
639 } else {
640 log << MSG::ERROR << "Application Manager Terminated with error code " << m_returnCode.value() << endmsg;
641 }
642
643 { // Force a disable the auditing of finalize for MessageSvc
644 auto prop = m_messageSvc.as<IProperty>();
645 if ( prop ) { prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore(); }
646 }
647 { // Force a disable the auditing of finalize for JobOptionsSvc
648 auto prop = m_jobOptionsSvc.as<IProperty>();
649 if ( prop ) { prop->setProperty( Gaudi::Property<bool>( "AuditFinalize", false ) ).ignore(); }
650 }
651
652 // finalize MessageSvc
653 auto svc = m_messageSvc.as<IService>();
654 if ( !svc ) {
655 log << MSG::ERROR << "Could not get the IService interface of the MessageSvc" << endmsg;
656 } else {
657 svc->sysFinalize().ignore();
658 }
659
660 // finalize JobOptionsSvc
661 svc = m_jobOptionsSvc.as<IService>();
662 if ( !svc ) {
663 log << MSG::ERROR << "Could not get the IService interface of the JobOptionsSvc" << endmsg;
664 } else {
665 svc->sysFinalize().ignore();
666 }
667
668 m_state = m_targetState;
669 return StatusCode::SUCCESS;
670 }
ApplicationMgr::m_targetState
Gaudi::StateMachine::State m_targetState
Internal State.
Definition: ApplicationMgr.h:204
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ApplicationMgr::m_returnCode
Gaudi::Property< int > m_returnCode
Property to record the error conditions occurring during the running.
Definition: ApplicationMgr.h:280
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
ApplicationMgr::m_jobOptionsSvc
SmartIF< IJobOptionsSvc > m_jobOptionsSvc
Reference to JobOption service.
Definition: ApplicationMgr.h:213
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
MSG::FATAL
Definition: IMessageSvc.h:15
IProperty::setProperty
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
IService
General service interface definition.
Definition: IService.h:18
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::ERROR
Definition: IMessageSvc.h:15
ApplicationMgr::m_state
Gaudi::StateMachine::State m_state
Internal State.
Definition: ApplicationMgr.h:203
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
MSG::INFO
Definition: IMessageSvc.h:15
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
ApplicationMgr::name
const std::string & name() const override
Definition: ApplicationMgr.cpp:846
ApplicationMgr::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
Reference to the message service.
Definition: ApplicationMgr.h:210
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## Member Data Documentation

## ◆ m_actHistory

Gaudi::Property<bool> ApplicationMgr::m_actHistory {this, "ActivateHistory", false, "Activate HistorySvc"}
| protected

Definition at line 239 of file ApplicationMgr.h.

## ◆ m_algManager

SmartIF<IAlgManager> ApplicationMgr::m_algManager
| protected

Cached pointer to the manager of algorithms.

Definition at line 170 of file ApplicationMgr.h.

## ◆ m_appName

Gaudi::Property<std::string> ApplicationMgr::m_appName {this, "AppName", "ApplicationMgr", "The name of the application"}
| protected

Definition at line 237 of file ApplicationMgr.h.

## ◆ m_appVersion

Gaudi::Property<std::string> ApplicationMgr::m_appVersion {this, "AppVersion", {}, "The version of the application"}
| protected

Definition at line 238 of file ApplicationMgr.h.

## ◆ m_asyncProcessor

SmartIF<IAsyncEventProcessor> ApplicationMgr::m_asyncProcessor
| protected

Reference to an asynchronous processing manager object.

Definition at line 215 of file ApplicationMgr.h.

## ◆ m_auditAlgs

Gaudi::Property<bool> ApplicationMgr::m_auditAlgs {this, "AuditAlgorithms", false}
| protected

Definition at line 257 of file ApplicationMgr.h.

## ◆ m_auditSvcs

Gaudi::Property<bool> ApplicationMgr::m_auditSvcs {this, "AuditServices", false}
| protected

Definition at line 256 of file ApplicationMgr.h.

## ◆ m_auditTools

Gaudi::Property<bool> ApplicationMgr::m_auditTools {this, "AuditTools", false}
| protected

Defaults for auditors.

Definition at line 255 of file ApplicationMgr.h.

## ◆ m_classManager

SmartIF<DLLClassManager> ApplicationMgr::m_classManager
| protected

Reference to the class manager.

Definition at line 175 of file ApplicationMgr.h.

## ◆ m_codeCheck

Gaudi::Property<bool> ApplicationMgr::m_codeCheck {this, "StatusCodeCheck", false, "Activate StatusCode checking"}
| protected

Definition at line 240 of file ApplicationMgr.h.

## ◆ m_createSvcNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_createSvcNameList
| protected

Initial value:
{
this, "CreateSvc", {}, "List of extra services to be created"}

Definition at line 251 of file ApplicationMgr.h.

## ◆ m_declaredManagers

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_declaredManagers
| protected

Property to declare the list of known managers.

Definition at line 164 of file ApplicationMgr.h.

## ◆ m_dllNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_dllNameList {this, "Dlls", {}, "List of DDL's names"}
| protected

Definition at line 225 of file ApplicationMgr.h.

## ◆ m_environment

Gaudi::Property<std::map<std::string, std::string> > ApplicationMgr::m_environment
| protected

Initial value:
{
this, "Environment", {}, "Environment variables to set"}

Definition at line 259 of file ApplicationMgr.h.

## ◆ m_eventLoopMgr

Gaudi::Property<std::string> ApplicationMgr::m_eventLoopMgr {this, "EventLoop", "EventLoopMgr", "Processing manager type"}
| protected

Definition at line 233 of file ApplicationMgr.h.

## ◆ m_evtMax

Gaudi::Property<int> ApplicationMgr::m_evtMax {this, "EvtMax", -1, "Number of events to be processed (-1 means all events)"}
| protected

Definition at line 220 of file ApplicationMgr.h.

## ◆ m_evtsel

Gaudi::Property<std::string> ApplicationMgr::m_evtsel {this, "EvtSel", {}, "Event selection"}
| protected

Definition at line 234 of file ApplicationMgr.h.

## ◆ m_extSvcCreates

Gaudi::Property<bool> ApplicationMgr::m_extSvcCreates
| protected

Initial value:
{this, "ExtSvcCreates", true,
"LHCb (default) or ATLAS definition of \"ExtSvc\""}

Definition at line 222 of file ApplicationMgr.h.

## ◆ m_extSvcNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_extSvcNameList {this, "ExtSvc", {}, "List of external services names"}
| protected

Definition at line 221 of file ApplicationMgr.h.

## ◆ m_histPersName

Gaudi::Property<std::string> ApplicationMgr::m_histPersName {this, "HistogramPersistency", "NONE", "Name of the Hist Pers Svc"}
| protected

Definition at line 235 of file ApplicationMgr.h.

## ◆ m_jobOptionsPath

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPath {this, "JobOptionsPath", {}, "The \"file\" to look for properties"}
| protected

Definition at line 227 of file ApplicationMgr.h.

## ◆ m_jobOptionsPostAction

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPostAction
| protected

Initial value:
{
this, "JobOptionsPreAction", {}, "additional command to run on config"}

Definition at line 230 of file ApplicationMgr.h.

## ◆ m_jobOptionsPreAction

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsPreAction
| protected

Initial value:
{
this, "JobOptionsPostAction", {}, "additional command to run on config"}

Definition at line 228 of file ApplicationMgr.h.

## ◆ m_jobOptionsSvc

SmartIF<IJobOptionsSvc> ApplicationMgr::m_jobOptionsSvc
| protected

Reference to JobOption service.

Definition at line 213 of file ApplicationMgr.h.

## ◆ m_jobOptionsSvcType

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsSvcType {this, "JobOptionsSvcType", "JobOptionsSvc", "JobOptionsSvc type"}
| protected

Definition at line 200 of file ApplicationMgr.h.

## ◆ m_jobOptionsType

Gaudi::Property<std::string> ApplicationMgr::m_jobOptionsType {this, "JobOptionsType", "FILE", "Source type (e.g. dbase, file...)"}
| protected

Definition at line 226 of file ApplicationMgr.h.

## ◆ m_loopCheck

Gaudi::Property<bool> ApplicationMgr::m_loopCheck
| protected

Initial value:
{this, "InitializationLoopCheck", true,
[this]( auto& ) { this->svcManager()->setLoopCheckEnabled( m_loopCheck ); },
"For ServiceMgr initialization loop checking"}

Definition at line 262 of file ApplicationMgr.h.

## ◆ m_managers

ManagersMap ApplicationMgr::m_managers
| protected

Map of known component managers.

It contains (at least) the managers for IService and IAlgorithm. IAlgTool and IAuditor are not mandatory (but a missing manager for IAlgTool will probably not allow any job to run).

Definition at line 162 of file ApplicationMgr.h.

## ◆ m_messageSvc

SmartIF<IMessageSvc> ApplicationMgr::m_messageSvc
| protected

Reference to the message service.

Definition at line 210 of file ApplicationMgr.h.

## ◆ m_messageSvcType

Gaudi::Property<std::string> ApplicationMgr::m_messageSvcType {this, "MessageSvcType", "MessageSvc", "MessageSvc type"}
| protected

Definition at line 199 of file ApplicationMgr.h.

## ◆ m_name

std::string ApplicationMgr::m_name = "ApplicationMgr"
| protected

Name.

Definition at line 202 of file ApplicationMgr.h.

## ◆ m_okDlls

std::vector<std::string> ApplicationMgr::m_okDlls
| private

names of successfully loaded dlls

Definition at line 290 of file ApplicationMgr.h.

## ◆ m_outputLevel

Gaudi::Property<int> ApplicationMgr::m_outputLevel {this, "OutputLevel", MSG::INFO, "Message output level"}
| protected

Definition at line 236 of file ApplicationMgr.h.

## ◆ m_outStreamNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_outStreamNameList
| protected

Initial value:
{
this, "OutStream", {}, &ApplicationMgr::evtLoopPropertyHandler, "List of output stream names"}

Definition at line 194 of file ApplicationMgr.h.

## ◆ m_outStreamType

Gaudi::Property<std::string> ApplicationMgr::m_outStreamType
| protected

Initial value:
{this, "OutStreamType", "OutputStream",
&ApplicationMgr::evtLoopPropertyHandler,
" Output stream type"}

Definition at line 196 of file ApplicationMgr.h.

## ◆ m_pluginDebugLevel

Gaudi::Property<int> ApplicationMgr::m_pluginDebugLevel
| protected

Initial value:
{
this, "PluginDebugLevel", 0,
[this]( auto& ) {
MsgStream log( m_messageSvc, this->name() );
log << MSG::INFO << "Updating Gaudi::PluginService::SetDebug(level) to level=" << m_pluginDebugLevel << endmsg;
Gaudi::PluginService::SetDebug( m_pluginDebugLevel );
},
"Debug level for the plugin system"}

Definition at line 241 of file ApplicationMgr.h.

## ◆ m_printAlgsSequence

Gaudi::Property<bool> ApplicationMgr::m_printAlgsSequence
| protected

Initial value:
{this, "PrintAlgsSequence", false,
"Print the sequence of algorithms that have been loaded."}

Definition at line 283 of file ApplicationMgr.h.

## ◆ m_processingMgr

SmartIF<IEventProcessor> ApplicationMgr::m_processingMgr
| protected

Reference to processing manager object.

Definition at line 212 of file ApplicationMgr.h.

## ◆ m_propertiesPrint

Gaudi::Property<bool> ApplicationMgr::m_propertiesPrint
| protected

Initial value:
{this, "PropertiesPrint", false,
"Flag to activate the printout of properties"}

Definition at line 276 of file ApplicationMgr.h.

## ◆ m_returnCode

Gaudi::Property<int> ApplicationMgr::m_returnCode
| protected

Initial value:
{this, "ReturnCode", Gaudi::ReturnCode::Success,
"Return code of the application. Set internally in case of error conditions."}

Property to record the error conditions occurring during the running.

Definition at line 280 of file ApplicationMgr.h.

## ◆ m_runable

SmartIF<IRunable> ApplicationMgr::m_runable
| protected

Reference to the runable object.

Definition at line 211 of file ApplicationMgr.h.

## ◆ m_runableType

Gaudi::Property<std::string> ApplicationMgr::m_runableType {this, "Runable", "AppMgrRunable", "Runable type"}
| protected

Definition at line 232 of file ApplicationMgr.h.

## ◆ m_SIExit

Gaudi::Property<int> ApplicationMgr::m_SIExit
| protected

Initial value:
{this, "Exit", 0,
[this]( auto& ) {
finalize().ignore();
terminate().ignore();
::exit( 0 );
},
"For SI's \"Exit\" command via callback"}

Definition at line 185 of file ApplicationMgr.h.

## ◆ m_SIGo

Gaudi::Property<int> ApplicationMgr::m_SIGo
| protected

Initial value:
{this, "Go", 0,
[this]( auto& ) {
this->reinitialize().ignore();
this->executeRun( m_evtMax ).ignore();
},
"For SI's \"Go\" command via callback"}

Definition at line 177 of file ApplicationMgr.h.

## ◆ m_stalledEventMonitoring

Gaudi::Property<bool> ApplicationMgr::m_stalledEventMonitoring
| protected

Initial value:
{
this, "StalledEventMonitoring", false, "Flag to enable/disable the monitoring and reporting of stalled events"}

Property to enable/disable the monitoring and reporting of stalled events.

See also
  StalledEventMonitor

Definition at line 273 of file ApplicationMgr.h.

## ◆ m_state

Gaudi::StateMachine::State ApplicationMgr::m_state = Gaudi::StateMachine::OFFLINE
| protected

Internal State.

Definition at line 203 of file ApplicationMgr.h.

## ◆ m_stopOnSignal

Gaudi::Property<bool> ApplicationMgr::m_stopOnSignal
| protected

Initial value:
{
this, "StopOnSignal", false, "Flag to enable/disable the signal handler that schedule a stop of the event loop"}

Property to enable/disable the "stop on signal" service.

See also
  Gaudi::Utils::StopSignalHandler

Definition at line 268 of file ApplicationMgr.h.

## ◆ m_svcLocator

SmartIF<ISvcLocator> ApplicationMgr::m_svcLocator
| mutable protected

Reference to its own service locator (must be instantiated prior to any service!)

Definition at line 173 of file ApplicationMgr.h.

## ◆ m_svcManager

SmartIF<ISvcManager> ApplicationMgr::m_svcManager
| protected

Cached pointer to the manager of services.

Definition at line 167 of file ApplicationMgr.h.

## ◆ m_svcMapping

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcMapping {this, "SvcMapping", {}, "Default mapping of services"}
| protected

Definition at line 206 of file ApplicationMgr.h.

## ◆ m_svcOptMapping

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_svcOptMapping
| protected

Initial value:
{
this, "SvcOptMapping", {}, "Default mapping of optional services"}

Definition at line 207 of file ApplicationMgr.h.

## ◆ m_targetState

Gaudi::StateMachine::State ApplicationMgr::m_targetState = Gaudi::StateMachine::OFFLINE
| protected

Internal State.

Definition at line 204 of file ApplicationMgr.h.

## ◆ m_topAlgNameList

Gaudi::Property<std::vector<std::string> > ApplicationMgr::m_topAlgNameList
| protected

Initial value:
{
this, "TopAlg", {}, &ApplicationMgr::evtLoopPropertyHandler, "List of top level algorithms names"}

Definition at line 192 of file ApplicationMgr.h.

## ◆ m_useHiveAlgorithmManager

bool ApplicationMgr::m_useHiveAlgorithmManager
| protected

Definition at line 287 of file ApplicationMgr.h.

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

- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h
- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp