| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
Gaudi::Utils::LockedChrono Class Reference

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

`#include <GaudiKernel/LockedChrono.h>`

Collaboration diagram for Gaudi::Utils::LockedChrono:
[legend]

## Public Member Functions
| LockedChrono (ChronoEntity &c, bool &lock)
| constructor from the actual timer: start the timer More...
| ~LockedChrono ()
| destructor: More...
| LockedChrono ()=delete
| no default constructor More...

## Private Attributes
ChronoEntity & | m_timer
| the actual timer More...
bool & | m_locker
| the actual locker More...
bool | m_locked = false
| locked ? More...

## 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
};

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 52 of file LockedChrono.h.

## Constructor & Destructor Documentation

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

constructor from the actual timer: start the timer

Definition at line 57 of file LockedChrono.h.

57 : m_timer( c ), m_locker( lock )
58 {
59 if ( !lock ) {
60 m_timer.start();
61 m_locker = true;
62 m_locked = true;
63 }
64 }
ChronoEntity::start
IChronoSvc::ChronoStatus start()
start the current chrono
Definition: ChronoEntity.cpp:47
Gaudi::Utils::LockedChrono::m_timer
ChronoEntity & m_timer
the actual timer
Definition: LockedChrono.h:80
Gaudi::Utils::LockedChrono::m_locker
bool & m_locker
the actual locker
Definition: LockedChrono.h:82
Gaudi::Utils::LockedChrono::m_locked
bool m_locked
locked ?
Definition: LockedChrono.h:84

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

destructor:

Definition at line 66 of file LockedChrono.h.

67 {
68 if ( m_locked ) {
69 m_timer.stop();
70 m_locker = false;
71 }
72 }
Gaudi::Utils::LockedChrono::m_timer
ChronoEntity & m_timer
the actual timer
Definition: LockedChrono.h:80
Gaudi::Utils::LockedChrono::m_locker
bool & m_locker
the actual locker
Definition: LockedChrono.h:82
Gaudi::Utils::LockedChrono::m_locked
bool m_locked
locked ?
Definition: LockedChrono.h:84
ChronoEntity::stop
IChronoSvc::ChronoStatus stop()
stop the chrono
Definition: ChronoEntity.cpp:65

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

no default constructor

## Member Data Documentation

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

locked ?

Definition at line 84 of file LockedChrono.h.

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

the actual locker

Definition at line 82 of file LockedChrono.h.

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

the actual timer

Definition at line 80 of file LockedChrono.h.

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

- GaudiKernel/GaudiKernel/LockedChrono.h