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 )
58  : m_timer ( c )
59  , m_locker ( lock )
60  {
61  if ( !lock )
62  {
63  m_timer.start() ;
64  m_locker = true ;
65  m_locked = true ;
66  }
67  }
70  {
71  if ( m_locked )
72  {
73  m_timer.stop () ;
74  m_locker = false ;
75  }
76  }
77  // ======================================================================
79  LockedChrono () = delete;
80  // ======================================================================
81  private:
82  // ======================================================================
84  ChronoEntity& m_timer ; // the actual timer
86  bool& m_locker ; // the actual locker
88  bool m_locked = false; // locked ?
89  // ======================================================================
90  } ;
91  // ========================================================================
92  } // end namespace Gaudi::Utils
93  // ==========================================================================
94 } // end of namespace Gaudi
95 // ============================================================================
96 // The END
97 // ============================================================================
98 #endif // GAUDI_LOCKEDCHRONO_H
99 // ============================================================================
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:84
LockedChrono()=delete
no default constructor
bool & m_locker
the actual locker
Definition: LockedChrono.h:86
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:69