The Gaudi Framework  v29r0 (ff2e7097)
AppMgrRunable.cpp
Go to the documentation of this file.
1 #define GAUDISVC_APPMGRRUNABLE_CPP
2 
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 
12 
13 // IService implementation: initialize the service
15 {
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
30 {
32  return sc;
33 }
34 
35 // IService implementation: initialize the service
37 {
39  return sc;
40 }
41 
42 // IService implementation: finalize the service
44 {
46  if ( m_appMgrUI ) m_appMgrUI->release();
47  m_appMgrUI = nullptr;
48  return sc;
49 }
50 
51 // IRunable implementation : Run the class implementation
53 {
54  if ( m_appMgrUI ) {
55  // loop over the events
56  return m_appMgrUI->nextEvent( m_evtMax );
57  }
58  return StatusCode::FAILURE;
59 }
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:1173
StatusCode initialize() override
Definition: Service.cpp:64
StatusCode start() override
IService implementation: start the service.
StatusCode finalize() override
Definition: Service.cpp:174
Class definition of AppMgrRunable.
Definition: AppMgrRunable.h:28
StatusCode start() override
Definition: Service.cpp:137
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
StatusCode finalize() override
IService implementation: finalize the service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
StatusCode run() override
IRunable implementation : Run the class implementation.
StatusCode stop() override
IService implementation: stop the service.
StatusCode stop() override
Definition: Service.cpp:130
virtual unsigned long release()=0
Release Interface instance.
Gaudi::Property< int > m_evtMax
Definition: AppMgrRunable.h:33
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:287
IAppMgrUI * m_appMgrUI
Reference to application manager UI.
Definition: AppMgrRunable.h:32