The Gaudi Framework  master (1304469f)
Loading...
Searching...
No Matches
AppMgrRunable.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 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
25 return base_class::initialize()
26 .andThen( [this] {
28 if ( !m_appMgrUI ) {
29 error() << "Failed to get IAppMgrUI" << endmsg;
31 }
33 } )
34 .andThen( [this]() -> StatusCode {
35 if ( m_evtMax == (int)0xFEEDBABE ) {
36 auto props = serviceLocator()->as<IProperty>();
37 return setProperty( props->getProperty( "EvtMax" ) );
38 }
40 } );
41}
42
43// IService implementation: initialize the service
48
49// IService implementation: initialize the service
52 return sc;
53}
54
55// IService implementation: finalize the service
58 if ( m_appMgrUI ) m_appMgrUI->release();
59 m_appMgrUI = nullptr;
60 return sc;
61}
62
63// IRunable implementation : Run the class implementation
65 if ( m_appMgrUI ) {
66 // loop over the events
67 return m_appMgrUI->nextEvent( m_evtMax );
68 }
70}
bool PyHelper setProperty(IInterface *p, char *name, char *value)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#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
SmartIF< IAppMgrUI > m_appMgrUI
Reference to application manager UI.
StatusCode start() override
IService implementation: start the service.
StatusCode run() override
IRunable implementation : Run the class implementation.
StatusCode stop() override
IService implementation: stop the service.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
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
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100