The Gaudi Framework
master (37c0b60a)
LockedChrono.h
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
#ifndef GAUDI_LOCKEDCHRONO_H
12
#define GAUDI_LOCKEDCHRONO_H 1
13
// ===========================================================================
14
// Include files
15
// ===========================================================================
16
// GaudiKernel
17
// ===========================================================================
18
#include <
GaudiKernel/ChronoEntity.h
>
19
// ===========================================================================
20
namespace
Gaudi
{
21
// =========================================================================
22
namespace
Utils {
23
// =======================================================================
60
class
LockedChrono
{
61
public
:
62
// ======================================================================
64
LockedChrono
(
ChronoEntity
&
c
,
bool
& lock ) :
m_timer
(
c
),
m_locker
( lock ) {
65
if
( !lock ) {
66
m_timer
.
start
();
67
m_locker
=
true
;
68
m_locked
=
true
;
69
}
70
}
72
~LockedChrono
() {
73
if
(
m_locked
) {
74
m_timer
.
stop
();
75
m_locker
=
false
;
76
}
77
}
78
// ======================================================================
80
LockedChrono
() =
delete
;
81
// ======================================================================
82
private
:
83
// ======================================================================
85
ChronoEntity
&
m_timer
;
// the actual timer
87
bool
&
m_locker
;
// the actual locker
89
bool
m_locked
=
false
;
// locked ?
90
// ======================================================================
91
};
92
// ========================================================================
93
}
// namespace Utils
94
// ==========================================================================
95
}
// end of namespace Gaudi
96
// ============================================================================
97
// The END
98
// ============================================================================
99
#endif // GAUDI_LOCKEDCHRONO_H
Gaudi::Utils::LockedChrono::LockedChrono
LockedChrono(ChronoEntity &c, bool &lock)
constructor from the actual timer: start the timer
Definition:
LockedChrono.h:64
ChronoEntity
Definition:
ChronoEntity.h:31
ChronoEntity::stop
IChronoSvc::ChronoStatus stop()
stop the chrono
Definition:
ChronoEntity.cpp:61
gaudirun.c
c
Definition:
gaudirun.py:525
Gaudi::Utils::LockedChrono::m_locked
bool m_locked
locked ?
Definition:
LockedChrono.h:89
ChronoEntity::start
IChronoSvc::ChronoStatus start()
start the current chrono
Definition:
ChronoEntity.cpp:46
Gaudi::Utils::LockedChrono
Definition:
LockedChrono.h:60
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition:
__init__.py:1
Gaudi::Utils::LockedChrono::m_timer
ChronoEntity & m_timer
the actual timer
Definition:
LockedChrono.h:85
Gaudi::Utils::LockedChrono::~LockedChrono
~LockedChrono()
destructor:
Definition:
LockedChrono.h:72
Gaudi::Utils::LockedChrono::LockedChrono
LockedChrono()=delete
no default constructor
ChronoEntity.h
Gaudi::Utils::LockedChrono::m_locker
bool & m_locker
the actual locker
Definition:
LockedChrono.h:87
GaudiKernel
include
GaudiKernel
LockedChrono.h
Generated on Thu Dec 19 2024 15:35:01 for The Gaudi Framework by
1.8.18