| The Gaudi Framework v30r0 (c919700c)

- 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/IAppMgrUI.h"
4 #include "GaudiKernel/ISvcLocator.h"
5 #include "GaudiKernel/SmartIF.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 {
16 StatusCode sc = Service::initialize();
17 if ( sc.isSuccess() ) {
18 sc = serviceLocator()->queryInterface( IAppMgrUI::interfaceID(), pp_cast<void>( &m_appMgrUI ) );
19 // get property from application manager
20 if ( m_evtMax == (int)0xFEEDBABE ) {
21 auto props = serviceLocator()->as<IProperty>();
22 setProperty( props->getProperty( "EvtMax" ) ).ignore();
23 }
24 }
25 return sc;
26 }
27
28 // IService implementation: initialize the service
29 StatusCode AppMgrRunable::start()
30 {
31 StatusCode sc = Service::start();
32 return sc;
33 }
34
35 // IService implementation: initialize the service
36 StatusCode AppMgrRunable::stop()
37 {
38 StatusCode sc = Service::stop();
39 return sc;
40 }
41
42 // IService implementation: finalize the service
43 StatusCode AppMgrRunable::finalize()
44 {
45 StatusCode sc = Service::finalize();
46 if ( m_appMgrUI ) m_appMgrUI->release();
47 m_appMgrUI = nullptr;
48 return sc;
49 }
50
51 // IRunable implementation : Run the class implementation
52 StatusCode AppMgrRunable::run()
53 {
54 if ( m_appMgrUI ) {
55 // loop over the events
56 return m_appMgrUI->nextEvent( m_evtMax );
57 }
58 return StatusCode::FAILURE;
59 }
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:1172
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:64
AppMgrRunable::start
StatusCode start() override
IService implementation: start the service.
Definition: AppMgrRunable.cpp: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:50
IAppMgrUI::nextEvent
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
AppMgrRunable::finalize
StatusCode finalize() override
IService implementation: finalize the service.
Definition: AppMgrRunable.cpp:43
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:52
AppMgrRunable::stop
StatusCode stop() override
IService implementation: stop the service.
Definition: AppMgrRunable.cpp:36
Service::stop
StatusCode stop() override
Definition: Service.cpp:130
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
StatusCode::FAILURE
Definition: StatusCode.h:29
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:287
ISvcLocator.h
AppMgrRunable::m_appMgrUI
IAppMgrUI * m_appMgrUI
Reference to application manager UI.
Definition: AppMgrRunable.h:32