The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
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
15namespace Gaudi {
16 namespace Utils {
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 }
63
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
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
ChronoEntity & m_timer
the actual timer
bool & m_locker
the actual locker
LockedChrono(ChronoEntity &c, bool &lock)
constructor from the actual timer: start the timer
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1