| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

AppMgrRunable.cpp
Go to the documentation of this file.
1 #define GAUDISVC_APPMGRRUNABLE_CPP
2
3 #include "GaudiKernel/SmartIF.h"
4 #include "GaudiKernel/IAppMgrUI.h"
5 #include "GaudiKernel/ISvcLocator.h"
6
7 #include "AppMgrRunable.h"
8
9 // Instantiation of a static factory class used by clients to create instances of this service
10
11 DECLARE_COMPONENT(AppMgrRunable)
12
13 // IService implementation: initialize the service
14 StatusCode AppMgrRunable::initialize() {
15 StatusCode sc = Service::initialize();
16 if ( sc.isSuccess() ) {
17 sc = serviceLocator()->queryInterface(IAppMgrUI::interfaceID(), pp_cast<void>(&m_appMgrUI));
18 // get property from application manager
19 if ( m_evtMax == (int)0xFEEDBABE ) {
20 auto props = serviceLocator()->as<IProperty>();
21 setProperty(props->getProperty("EvtMax")).ignore();
22 }
23 }
24 return sc;
25 }
26
27 // IService implementation: initialize the service
28 StatusCode AppMgrRunable::start() {
29 StatusCode sc = Service::start();
30 return sc;
31 }
32
33 // IService implementation: initialize the service
34 StatusCode AppMgrRunable::stop() {
35 StatusCode sc = Service::stop();
36 return sc;
37 }
38
39 // IService implementation: finalize the service
40 StatusCode AppMgrRunable::finalize() {
41 StatusCode sc = Service::finalize();
42 if ( m_appMgrUI ) m_appMgrUI->release();
43 m_appMgrUI = nullptr;
44 return sc;
45 }
46
47 // IRunable implementation : Run the class implementation
48 StatusCode AppMgrRunable::run() {
49 if ( m_appMgrUI ) {
50 // loop over the events
51 return m_appMgrUI->nextEvent(m_evtMax);
52 }
53 return StatusCode::FAILURE;
54 }
Gaudi::Utils::setProperty
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1138
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:64
AppMgrRunable::start
StatusCode start() override
IService implementation: start the service.
Definition: AppMgrRunable.cpp:28
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
IAppMgrUI.h
AppMgrRunable
Class definition of AppMgrRunable.
Definition: AppMgrRunable.h:28
Service::start
StatusCode start() override
Definition: Service.cpp:137
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
IAppMgrUI::nextEvent
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
AppMgrRunable::finalize
StatusCode finalize() override
IService implementation: finalize the service.
Definition: AppMgrRunable.cpp:40
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF.h
AppMgrRunable.h
AppMgrRunable::run
StatusCode run() override
IRunable implementation : Run the class implementation.
Definition: AppMgrRunable.cpp:48
AppMgrRunable::stop
StatusCode stop() override
IService implementation: stop the service.
Definition: AppMgrRunable.cpp:34
Service::stop
StatusCode stop() override
Definition: Service.cpp:130
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
AppMgrRunable::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: AppMgrRunable.h:33
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
IInterface::interfaceID
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:243
ISvcLocator.h
AppMgrRunable::m_appMgrUI
IAppMgrUI * m_appMgrUI
Reference to application manager UI.
Definition: AppMgrRunable.h:32