Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
14 StatusCode AppMgrRunable::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
30  return sc;
31 }
32 
33 // IService implementation: initialize the service
36  return sc;
37 }
38 
39 // IService implementation: finalize the service
42  if ( m_appMgrUI ) m_appMgrUI->release();
43  m_appMgrUI = nullptr;
44  return sc;
45 }
46 
47 // IRunable implementation : Run the class implementation
49  if ( m_appMgrUI ) {
50  // loop over the events
51  return m_appMgrUI->nextEvent( m_evtMax );
52  }
53  return StatusCode::FAILURE;
54 }
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:1178
StatusCode initialize() override
Definition: Service.cpp:60
StatusCode start() override
IService implementation: start the service.
StatusCode finalize() override
Definition: Service.cpp:164
Class definition of AppMgrRunable.
Definition: AppMgrRunable.h:28
StatusCode start() override
Definition: Service.cpp:129
bool isSuccess() const
Definition: StatusCode.h:267
virtual StatusCode nextEvent(int maxevt)=0
Process the next maxevt events.
StatusCode finalize() override
IService implementation: finalize the service.
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode run() override
IRunable implementation : Run the class implementation.
StatusCode stop() override
IService implementation: stop the service.
StatusCode stop() override
Definition: Service.cpp:123
virtual unsigned long release()=0
Release Interface instance.
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Gaudi::Property< int > m_evtMax
Definition: AppMgrRunable.h:32
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:253
IAppMgrUI * m_appMgrUI
Reference to application manager UI.
Definition: AppMgrRunable.h:31