Gaudi Framework, version v21r9

Home   Generated: 3 May 2010

Gaudi::Utils::LockedChrono Class Reference

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

#include <LockedChrono.h>

Collaboration diagram for Gaudi::Utils::LockedChrono:

Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Private Member Functions

 LockedChrono ()
 no default constructor

Private Attributes

ChronoEntitym_timer
 the actual timer
boolm_locker
 the actual locker
bool m_locked
 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 

  };

Author:
Vanya BELYAEV Ivan.Belyaev@nikhef.nl
Date:
2009-08-10

Definition at line 54 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 59 of file LockedChrono.h.

00060         : m_timer  ( c     ) 
00061         , m_locker ( lock  )
00062         , m_locked ( false )
00063       {
00064         if  ( !lock ) 
00065         {
00066           m_timer.start() ;
00067           m_locker = true ;
00068           m_locked = true ;
00069         }  
00070       }

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

destructor:

Definition at line 72 of file LockedChrono.h.

00073       { 
00074         if  ( m_locked ) 
00075         { 
00076           m_timer.stop  () ;
00077           m_locker = false ;
00078         }  
00079       }

Gaudi::Utils::LockedChrono::LockedChrono (  )  [private]

no default constructor


Member Data Documentation

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

the actual timer

Definition at line 89 of file LockedChrono.h.

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

the actual locker

Definition at line 91 of file LockedChrono.h.

bool Gaudi::Utils::LockedChrono::m_locked [private]

locked ?

Definition at line 93 of file LockedChrono.h.


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

Generated at Mon May 3 12:28:46 2010 for Gaudi Framework, version v21r9 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004