| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 // Standard Constructor
14 AppMgrRunable::AppMgrRunable(const std::string& nam, ISvcLocator* svcLoc)
15 : base_class(nam, svcLoc), m_appMgrUI(0)
16 {
17 declareProperty("EvtMax", m_evtMax=0xFEEDBABE);
18 }
19
20 // Standard Destructor
21 AppMgrRunable::~AppMgrRunable()
22 {
23 }
24
25 // IService implementation: initialize the service
26 StatusCode AppMgrRunable::initialize() {
27 StatusCode sc = Service::initialize();
28 if ( sc.isSuccess() ) {
29 sc = serviceLocator()->queryInterface(IAppMgrUI::interfaceID(), pp_cast<void>(&m_appMgrUI));
30 // get property from application manager
31 if ( m_evtMax == (int)0xFEEDBABE ) {
32 SmartIF<IProperty> props(serviceLocator());
33 setProperty(props->getProperty("EvtMax")).ignore();
34 }
35 }
36 return sc;
37 }
38
39 // IService implementation: initialize the service
40 StatusCode AppMgrRunable::start() {
41 StatusCode sc = Service::start();
42 return sc;
43 }
44
45 // IService implementation: initialize the service
46 StatusCode AppMgrRunable::stop() {
47 StatusCode sc = Service::stop();
48 return sc;
49 }
50
51 // IService implementation: finalize the service
52 StatusCode AppMgrRunable::finalize() {
53 StatusCode sc = Service::finalize();
54 if ( 0 != m_appMgrUI ) m_appMgrUI->release();
55 m_appMgrUI = 0;
56 return sc;
57 }
58
59 // IRunable implementation : Run the class implementation
60 StatusCode AppMgrRunable::run() {
61 if ( 0 != m_appMgrUI ) {
62 // loop over the events
63 return m_appMgrUI->nextEvent(m_evtMax);
64 }
65 return StatusCode::FAILURE;
66 }