All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Chrono.h
Go to the documentation of this file.
1 // $Id: Chrono.h,v 1.6 2008/05/13 12:36:54 marcocle Exp $
2 // ============================================================================
3 #ifndef GAUDIKERNEL_CHRONO_H
4 #define GAUDIKERNEL_CHRONO_H
5 // ============================================================================
6 // Include files
7 // ============================================================================
8 // STD& STL
9 // ============================================================================
10 #include <string>
11 // ============================================================================
12 // GaudiKernel
13 // ============================================================================
14 #include "GaudiKernel/Kernel.h"
15 #include "GaudiKernel/IChronoSvc.h"
17 // ============================================================================
28 {
29 public:
30  // =========================================================================
52  Chrono
53  ( IChronoSvc* svc = 0 , // the service
54  const std::string& tag = "CHRONO::UNNAMED" ) // the unique tag/name
55  : m_chrono ( 0 )
56  { if ( 0 != svc ) { m_chrono = svc -> chronoStart ( tag ) ; } }
57  // =========================================================================
79  Chrono
80  ( const std::string& tag , // the unique tag/name
81  IChronoSvc* svc ) // the service
82  : m_chrono ( 0 )
83  { if ( 0 != svc ) { m_chrono = svc -> chronoStart ( tag ) ; } }
84  // =========================================================================
105  Chrono ( ChronoEntity* c ) : m_chrono ( c )
106  { if ( 0 != m_chrono ) { m_chrono -> start () ; } }
107  // =========================================================================
128  Chrono ( ChronoEntity& c ) : m_chrono ( &c ) { m_chrono -> start () ; }
129  // =========================================================================
131  ~Chrono () { if ( 0 != m_chrono ) { m_chrono->stop() ; } }
132  // =========================================================================
133 private:
134  // =========================================================================
136  Chrono ( const Chrono& ) ; // no copy constructor
138  Chrono& operator=( const Chrono& ) ; // no assignment
139  // =========================================================================
140 private:
141  // ==========================================================================
143  ChronoEntity* m_chrono; // The actual chronometer
144  // ==========================================================================
145 };
146 // ============================================================================
147 // The END
148 // ============================================================================
149 #endif // GAUDIKERNEL_CHRONO_H
150 // ============================================================================
151 
152 
~Chrono()
Destructor , stop the chrono.
Definition: Chrono.h:131
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Definition: ChronoEntity.h:21
tuple c
Definition: gaudirun.py:341
A small utility class for chronometry of user codes.
Definition: Chrono.h:27
Chrono(ChronoEntity *c)
Constructor from Chrono Object/Entity.
Definition: Chrono.h:105
Chrono(ChronoEntity &c)
Constructor from Chrono Object/Entity.
Definition: Chrono.h:128
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:143
#define GAUDI_API
Definition: Kernel.h:108
"Chrono"-related part of interface IChronoStatSvc
Definition: IChronoSvc.h:33
tuple start
Definition: IOTest.py:88