The Gaudi Framework  master (37c0b60a)
ComponentManager.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef COMPONENTMANAGER_H_
12 #define COMPONENTMANAGER_H_
13 
16 
17 class ApplicationMgr;
18 
25 class GAUDI_API ComponentManager : public CommonMessaging<implements<IComponentManager>> {
26 public:
30 
32  const InterfaceID& componentBaseInterface() const override;
33 
37  StatusCode queryInterface( const InterfaceID& iid, void** pinterface ) override;
38 
40  if ( !m_svcLocator ) m_svcLocator = m_application;
41  return m_svcLocator;
42  }
43 
45  StatusCode configure() override { return StatusCode::SUCCESS; }
46 
48  StatusCode initialize() override { return StatusCode::SUCCESS; }
49 
51  StatusCode start() override { return StatusCode::SUCCESS; }
52 
54  StatusCode stop() override { return StatusCode::SUCCESS; }
55 
57  StatusCode finalize() override { return StatusCode::SUCCESS; }
58 
60  StatusCode terminate() override { return StatusCode::SUCCESS; }
61 
64 
66  StatusCode restart() override { return StatusCode::SUCCESS; }
67 
69  Gaudi::StateMachine::State FSMState() const override { return m_stateful->FSMState(); }
70 
73  Gaudi::StateMachine::State targetFSMState() const override { return m_stateful->targetFSMState(); }
74 
75 protected:
78 
81 
84 
87 
89 };
90 
91 #endif /* COMPONENTMANAGER_H_ */
ComponentManager::initialize
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).
Definition: ComponentManager.h:48
ComponentManager::targetFSMState
Gaudi::StateMachine::State targetFSMState() const override
When we are in the middle of a transition, get the state where the transition is leading us.
Definition: ComponentManager.h:73
ComponentManager
Definition: ComponentManager.h:25
ComponentManager::restart
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
Definition: ComponentManager.h:66
Gaudi::StateMachine::State
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
Definition: StateMachine.h:22
ComponentManager::m_application
SmartIF< IInterface > m_application
Pointer to the owner of the manager.
Definition: ComponentManager.h:77
StatusCode
Definition: StatusCode.h:65
ComponentManager::configure
StatusCode configure() override
Configuration (from OFFLINE to CONFIGURED).
Definition: ComponentManager.h:45
CommonMessaging
Definition: CommonMessaging.h:66
ComponentManager::m_basicInterfaceId
InterfaceID m_basicInterfaceId
Basic interface id of the managed components.
Definition: ComponentManager.h:83
SmartIF< ISvcLocator >
CommonMessaging.h
ComponentManager::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Definition: ComponentManager.h:39
ComponentManager::m_stateful
SmartIF< IStateful > m_stateful
Pointer to the IStateful interface of the owner.
Definition: ComponentManager.h:80
ComponentManager::start
StatusCode start() override
Start (from INITIALIZED to RUNNING).
Definition: ComponentManager.h:51
ComponentManager::terminate
StatusCode terminate() override
Initialization (from CONFIGURED to OFFLINE).
Definition: ComponentManager.h:60
ComponentManager::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Definition: ComponentManager.h:86
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
ComponentManager::stop
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
Definition: ComponentManager.h:54
IComponentManager.h
ApplicationMgr
Definition: ApplicationMgr.h:57
IInterface
Definition: IInterface.h:239
ComponentManager::reinitialize
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: ComponentManager.h:63
InterfaceID
Definition: IInterface.h:39
ComponentManager::finalize
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
Definition: ComponentManager.h:57
ComponentManager::ApplicationMgr
friend ApplicationMgr
Definition: ComponentManager.h:88
gaudirun.application
application
Definition: gaudirun.py:323
ComponentManager::FSMState
Gaudi::StateMachine::State FSMState() const override
Get the current state.
Definition: ComponentManager.h:69
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81