The Gaudi Framework
master (181af51f)
Loading...
Searching...
No Matches
ReEntAlg.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
#include "
ReEntAlg.h
"
12
#include <
GaudiKernel/ISvcLocator.h
>
13
#include <
GaudiKernel/MsgStream.h
>
14
15
#include <chrono>
16
#include <thread>
17
18
DECLARE_COMPONENT
(
ReEntAlg
)
19
20
21
22
ReEntAlg
::
ReEntAlg
( const
std
::
string
&
name
,
ISvcLocator
* pSvcLocator ) :
Gaudi
::
Algorithm
(
name
, pSvcLocator ) {}
23
24
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25
26
StatusCode
ReEntAlg::initialize
() {
27
auto
sc =
Gaudi::Algorithm::initialize
();
28
if
( !sc )
return
sc;
29
info
() <<
"initialize()"
<<
endmsg
;
30
return
sc;
31
}
32
33
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
34
35
StatusCode
ReEntAlg::execute
(
const
EventContext
& ctx )
const
{
36
// wait a little bit to make sure the printouts are in a stable order
37
std::this_thread::sleep_for( std::chrono::milliseconds( 50 * ctx.slot() ) );
38
39
info
() <<
"execute(): context: ("
<< ctx <<
") index: "
<<
index
() <<
" cardinality: "
<<
cardinality
() <<
endmsg
;
40
41
std::chrono::milliseconds dt{
m_sleep
+ ctx.slot() * 500 };
42
std::this_thread::sleep_for( dt );
43
44
info
() <<
"... done in "
<< dt.count() <<
" ms for "
<< ctx <<
endmsg
;
45
std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) );
46
47
return
StatusCode::SUCCESS
;
48
}
49
50
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
51
52
StatusCode
ReEntAlg::finalize
() {
53
info
() <<
"finalize()"
<<
endmsg
;
54
return
Gaudi::Algorithm::finalize
();
55
}
ISvcLocator.h
MsgStream.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
ReEntAlg.h
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition
CommonMessaging.h:113
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:34
Gaudi::Algorithm::Algorithm
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition
Algorithm.h:98
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition
Algorithm.h:175
Gaudi::Algorithm::finalize
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Definition
Algorithm.h:181
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition
Algorithm.cpp:529
Gaudi::Algorithm::index
unsigned int index() const override
Definition
Algorithm.cpp:535
Gaudi::Algorithm::cardinality
unsigned int cardinality() const override
Return the cardinality.
Definition
Algorithm.h:395
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
ReEntAlg::initialize
StatusCode initialize() override
Definition
ReEntAlg.cpp:26
ReEntAlg::finalize
StatusCode finalize() override
Definition
ReEntAlg.cpp:52
ReEntAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition
ReEntAlg.cpp:35
ReEntAlg::m_sleep
Gaudi::Property< unsigned int > m_sleep
Definition
ReEntAlg.h:28
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
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
ReEntAlg
Definition
ReEntAlg.py:1
std
STL namespace.
GaudiTestSuite
src
ReEntAlg
ReEntAlg.cpp
Generated on Wed Oct 8 2025 09:53:38 for The Gaudi Framework by
1.13.1