The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::Utils::LockedChrono Class Reference

Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/LockedChrono.h>

Collaboration diagram for Gaudi::Utils::LockedChrono:

Public Member Functions

 LockedChrono (ChronoEntity &c, bool &lock)
 constructor from the actual timer: start the timer
 
 ~LockedChrono ()
 destructor:
 
 LockedChrono ()=delete
 

Private Attributes

ChronoEntitym_timer
 the actual timer
 
bool & m_locker
 the actual locker
 
bool m_locked = false
 locked ?
 

Detailed Description

Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g.

Data-On-Demand service, complex algorithms, etc...

class MyClass ...
{
public:
void doSomethingRecursive() const
{
...
LockedChrono timer ( m_chrono , m_lock ) ;
...
// some direct or indirect recursive call:
if ( ... ) { doSomethingRecursive () ; }
...
}
private:
mutable bool m_lock ; // lock
mutable ChronoEntity m_chrono ; // actual timer
};
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
LockedChrono(ChronoEntity &c, bool &lock)
constructor from the actual timer: start the timer
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-08-10

Definition at line 53 of file LockedChrono.h.

Constructor & Destructor Documentation

◆ LockedChrono() [1/2]

Gaudi::Utils::LockedChrono::LockedChrono ( ChronoEntity & c,
bool & lock )
inline

constructor from the actual timer: start the timer

Definition at line 56 of file LockedChrono.h.

56 : m_timer( c ), m_locker( lock ) {
57 if ( !lock ) {
58 m_timer.start();
59 m_locker = true;
60 m_locked = true;
61 }
62 }
ChronoEntity & m_timer
the actual timer
bool & m_locker
the actual locker

◆ ~LockedChrono()

Gaudi::Utils::LockedChrono::~LockedChrono ( )
inline

destructor:

Definition at line 64 of file LockedChrono.h.

64 {
65 if ( m_locked ) {
66 m_timer.stop();
67 m_locker = false;
68 }
69 }

◆ LockedChrono() [2/2]

Gaudi::Utils::LockedChrono::LockedChrono ( )
delete

Member Data Documentation

◆ m_locked

bool Gaudi::Utils::LockedChrono::m_locked = false
private

locked ?

Definition at line 78 of file LockedChrono.h.

◆ m_locker

bool& Gaudi::Utils::LockedChrono::m_locker
private

the actual locker

Definition at line 76 of file LockedChrono.h.

◆ m_timer

ChronoEntity& Gaudi::Utils::LockedChrono::m_timer
private

the actual timer

Definition at line 74 of file LockedChrono.h.


The documentation for this class was generated from the following file: