The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
AppMgrRunable.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#define GAUDISVC_APPMGRRUNABLE_CPP
12
15#include <GaudiKernel/SmartIF.h>
16
17#include "AppMgrRunable.h"
18
19// Instantiation of a static factory class used by clients to create instances of this service
20
22
23// IService implementation: initialize the service
26 if ( sc.isSuccess() ) {
27 sc = serviceLocator()->queryInterface( IAppMgrUI::interfaceID(), pp_cast<void>( &m_appMgrUI ) );
28 // get property from application manager
29 if ( m_evtMax == (int)0xFEEDBABE ) {
30 auto props = serviceLocator()->as<IProperty>();
31 setProperty( props->getProperty( "EvtMax" ) ).ignore();
32 }
33 }
34 return sc;
35}
36
37// IService implementation: initialize the service
42
43// IService implementation: initialize the service
46 return sc;
47}
48
49// IService implementation: finalize the service
52 if ( m_appMgrUI ) m_appMgrUI->release();
53 m_appMgrUI = nullptr;
54 return sc;
55}
56
57// IRunable implementation : Run the class implementation
59 if ( m_appMgrUI ) {
60 // loop over the events
61 return m_appMgrUI->nextEvent( m_evtMax );
62 }
64}
bool PyHelper setProperty(IInterface *p, char *name, char *value)
DEST ** pp_cast(SRC **ptr)
Small function to be used instead of the construct (void**)&pointer, which produces,...
Definition IInterface.h:370
#define DECLARE_COMPONENT(type)
Class definition of AppMgrRunable.
StatusCode initialize() override
IService implementation: initialize the service.
StatusCode finalize() override
IService implementation: finalize the service.
Gaudi::Property< int > m_evtMax
StatusCode start() override
IService implementation: start the service.
StatusCode run() override
IRunable implementation : Run the class implementation.
IAppMgrUI * m_appMgrUI
Reference to application manager UI.
StatusCode stop() override
IService implementation: stop the service.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition IInterface.h:234
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition IProperty.h:32
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
StatusCode finalize() override
Definition Service.cpp:223
StatusCode stop() override
Definition Service.cpp:181
StatusCode start() override
Definition Service.cpp:187
StatusCode initialize() override
Definition Service.cpp:118
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto FAILURE
Definition StatusCode.h:100