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"
6 
7 #include "AppMgrRunable.h"
8 
9 // Instantiation of a static factory class used by clients to create instances of this service
10 
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
22 {
23 }
24 
25 // IService implementation: initialize the service
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 ) {
33  setProperty(props->getProperty("EvtMax")).ignore();
34  }
35  }
36  return sc;
37 }
38 
39 // IService implementation: initialize the service
42  return sc;
43 }
44 
45 // IService implementation: initialize the service
48  return sc;
49 }
50 
51 // IService implementation: finalize the service
54  if ( 0 != m_appMgrUI ) m_appMgrUI->release();
55  m_appMgrUI = 0;
56  return sc;
57 }
58 
59 // IRunable implementation : Run the class implementation
61  if ( 0 != m_appMgrUI ) {
62  // loop over the events
63  return m_appMgrUI->nextEvent(m_evtMax);
64  }
65  return StatusCode::FAILURE;
66 }
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
Definition: Service.cpp:152
virtual StatusCode setProperty(const Property &p)
Set the property by property.
Definition: Service.cpp:342
Class definition of AppMgrRunable.
Definition: AppMgrRunable.h:29
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual ~AppMgrRunable()
Standard Destructor.
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
virtual StatusCode run()
IRunable implementation : Run the class implementation.
virtual StatusCode start()
IService implementation: start the service.
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
int m_evtMax
Number of events to be processed.
Definition: AppMgrRunable.h:34
virtual StatusCode finalize()
IService implementation: finalize the service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode initialize()
IService implementation: initialize the service.
virtual StatusCode stop()
IService implementation: stop the service.
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:74
Templated class to add the standard messaging functionalities.
virtual StatusCode start()
Start (from INITIALIZED to RUNNING).
Definition: Service.cpp:158
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:171
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:199
IAppMgrUI * m_appMgrUI
Reference to application manager UI.
Definition: AppMgrRunable.h:32
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336