Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LockedChrono.h
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 #pragma once
12 
14 
15 namespace Gaudi {
16  namespace Utils {
53  class LockedChrono {
54  public:
56  LockedChrono( ChronoEntity& c, bool& lock ) : m_timer( c ), m_locker( lock ) {
57  if ( !lock ) {
58  m_timer.start();
59  m_locker = true;
60  m_locked = true;
61  }
62  }
65  if ( m_locked ) {
66  m_timer.stop();
67  m_locker = false;
68  }
69  }
70  LockedChrono() = delete;
71 
72  private:
74  ChronoEntity& m_timer; // the actual timer
76  bool& m_locker; // the actual locker
78  bool m_locked = false; // locked ?
79  };
80  } // namespace Utils
81 } // namespace Gaudi
Gaudi::Utils::LockedChrono::LockedChrono
LockedChrono(ChronoEntity &c, bool &lock)
constructor from the actual timer: start the timer
Definition: LockedChrono.h:56
ChronoEntity
Definition: ChronoEntity.h:26
ChronoEntity::stop
IChronoSvc::ChronoStatus stop()
stop the chrono
Definition: ChronoEntity.cpp:50
gaudirun.c
c
Definition: gaudirun.py:525
Gaudi::Utils::LockedChrono::m_locked
bool m_locked
locked ?
Definition: LockedChrono.h:78
ChronoEntity::start
IChronoSvc::ChronoStatus start()
start the current chrono
Definition: ChronoEntity.cpp:35
Gaudi::Utils::LockedChrono
Definition: LockedChrono.h:53
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:74
Gaudi::Utils::LockedChrono::~LockedChrono
~LockedChrono()
destructor:
Definition: LockedChrono.h:64
Gaudi::Utils::LockedChrono::LockedChrono
LockedChrono()=delete
ChronoEntity.h
Gaudi::Utils::LockedChrono::m_locker
bool & m_locker
the actual locker
Definition: LockedChrono.h:76