The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
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
13
#include <
GaudiKernel/IAppMgrUI.h
>
14
#include <
GaudiKernel/ISvcLocator.h
>
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
21
DECLARE_COMPONENT
(
AppMgrRunable
)
22
23
// IService implementation: initialize the service
24
StatusCode
AppMgrRunable
::
initialize
() {
25
return
base_class::initialize()
26
.andThen( [
this
] {
27
m_appMgrUI
=
serviceLocator
();
28
if
( !
m_appMgrUI
) {
29
error
() <<
"Failed to get IAppMgrUI"
<<
endmsg
;
30
return
StatusCode::FAILURE
;
31
}
32
return
StatusCode::SUCCESS
;
33
} )
34
.andThen( [
this
]() ->
StatusCode
{
35
if
(
m_evtMax
== (
int
)0xFEEDBABE ) {
36
auto
props =
serviceLocator
()->as<
IProperty
>();
37
return
setProperty
( props->getProperty(
"EvtMax"
) );
38
}
39
return
StatusCode::SUCCESS
;
40
} );
41
}
42
43
// IService implementation: initialize the service
44
StatusCode
AppMgrRunable::start
() {
45
StatusCode
sc =
Service::start
();
46
return
sc;
47
}
48
49
// IService implementation: initialize the service
50
StatusCode
AppMgrRunable::stop
() {
51
StatusCode
sc =
Service::stop
();
52
return
sc;
53
}
54
55
// IService implementation: finalize the service
56
StatusCode
AppMgrRunable::finalize
() {
57
StatusCode
sc =
Service::finalize
();
58
if
(
m_appMgrUI
)
m_appMgrUI
->release();
59
m_appMgrUI
=
nullptr
;
60
return
sc;
61
}
62
63
// IRunable implementation : Run the class implementation
64
StatusCode
AppMgrRunable::run
() {
65
if
(
m_appMgrUI
) {
66
// loop over the events
67
return
m_appMgrUI
->nextEvent(
m_evtMax
);
68
}
69
return
StatusCode::FAILURE
;
70
}
AppMgrRunable.h
setProperty
bool PyHelper setProperty(IInterface *p, char *name, char *value)
Definition
Bootstrap.cpp:211
IAppMgrUI.h
ISvcLocator.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
SmartIF.h
AppMgrRunable
Class definition of AppMgrRunable.
Definition
AppMgrRunable.h:35
AppMgrRunable::initialize
StatusCode initialize() override
IService implementation: initialize the service.
Definition
AppMgrRunable.cpp:24
AppMgrRunable::finalize
StatusCode finalize() override
IService implementation: finalize the service.
Definition
AppMgrRunable.cpp:56
AppMgrRunable::m_evtMax
Gaudi::Property< int > m_evtMax
Definition
AppMgrRunable.h:39
AppMgrRunable::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to application manager UI.
Definition
AppMgrRunable.h:38
AppMgrRunable::start
StatusCode start() override
IService implementation: start the service.
Definition
AppMgrRunable.cpp:44
AppMgrRunable::run
StatusCode run() override
IRunable implementation : Run the class implementation.
Definition
AppMgrRunable.cpp:64
AppMgrRunable::stop
StatusCode stop() override
IService implementation: stop the service.
Definition
AppMgrRunable.cpp:50
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition
CommonMessaging.h:109
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition
IProperty.h:32
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition
Service.cpp:336
Service::finalize
StatusCode finalize() override
Definition
Service.cpp:223
Service::stop
StatusCode stop() override
Definition
Service.cpp:181
Service::start
StatusCode start() override
Definition
Service.cpp:187
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition
StatusCode.h:100
GaudiCoreSvc
src
ApplicationMgr
AppMgrRunable.cpp
Generated on
for The Gaudi Framework by
1.17.0