The Gaudi Framework  v30r3 (a5ef0a68)
LockedChrono.h
Go to the documentation of this file.
1 #ifndef GAUDI_LOCKEDCHRONO_H
2 #define GAUDI_LOCKEDCHRONO_H 1
3 // ===========================================================================
4 // Include files
5 // ===========================================================================
6 // GaudiKernel
7 // ===========================================================================
9 // ===========================================================================
10 namespace Gaudi
11 {
12  // =========================================================================
13  namespace Utils
14  {
15  // =======================================================================
53  {
54  public:
55  // ======================================================================
57  LockedChrono( ChronoEntity& c, bool& lock ) : m_timer( c ), m_locker( lock )
58  {
59  if ( !lock ) {
60  m_timer.start();
61  m_locker = true;
62  m_locked = true;
63  }
64  }
67  {
68  if ( m_locked ) {
69  m_timer.stop();
70  m_locker = false;
71  }
72  }
73  // ======================================================================
75  LockedChrono() = delete;
76  // ======================================================================
77  private:
78  // ======================================================================
80  ChronoEntity& m_timer; // the actual timer
82  bool& m_locker; // the actual locker
84  bool m_locked = false; // locked ?
85  // ======================================================================
86  };
87  // ========================================================================
88  } // end namespace Gaudi::Utils
89  // ==========================================================================
90 } // end of namespace Gaudi
91 // ============================================================================
92 // The END
93 // ============================================================================
94 #endif // GAUDI_LOCKEDCHRONO_H
95 // ============================================================================
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Definition: ChronoEntity.h:21
IChronoSvc::ChronoStatus start()
start the current chrono
ChronoEntity & m_timer
the actual timer
Definition: LockedChrono.h:80
LockedChrono()=delete
no default constructor
bool & m_locker
the actual locker
Definition: LockedChrono.h:82
LockedChrono(ChronoEntity &c, bool &lock)
constructor from the actual timer: start the timer
Definition: LockedChrono.h:57
Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g.
Definition: LockedChrono.h:52
IChronoSvc::ChronoStatus stop()
stop the chrono
Helper functions to set/get the application return code.
Definition: __init__.py:1
~LockedChrono()
destructor:
Definition: LockedChrono.h:66