Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v28r2p1 (f1a77ff4)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Chrono.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_CHRONO_H
2 #define GAUDIKERNEL_CHRONO_H
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD& STL
7 // ============================================================================
8 #include <string>
9 // ============================================================================
10 // GaudiKernel
11 // ============================================================================
12 #include "GaudiKernel/Kernel.h"
13 #include "GaudiKernel/IChronoSvc.h"
15 // ============================================================================
26 {
27 public:
28  // =========================================================================
50  Chrono
51  ( IChronoSvc* svc = nullptr , // the service
52  const std::string& tag = "CHRONO::UNNAMED" ) // the unique tag/name
53  { if ( svc ) { m_chrono = svc -> chronoStart ( tag ) ; } }
54 
55  // =========================================================================
59  Chrono(Chrono&& rhs)
60  { m_chrono = rhs.m_chrono; rhs.m_chrono = nullptr; }
61 
62  // =========================================================================
84  Chrono
85  ( const std::string& tag , // the unique tag/name
86  IChronoSvc* svc ) // the service
87  { if ( svc ) { m_chrono = svc -> chronoStart ( tag ) ; } }
88  // =========================================================================
109  Chrono ( ChronoEntity* c ) : m_chrono ( c )
110  { if ( m_chrono ) { m_chrono -> start () ; } }
111  // =========================================================================
132  Chrono ( ChronoEntity& c ) : m_chrono ( &c ) { m_chrono -> start () ; }
133  // =========================================================================
135  ~Chrono () { if ( m_chrono ) { m_chrono->stop() ; } }
136  // =========================================================================
137 private:
138  // =========================================================================
140  Chrono ( const Chrono& ) = delete;
141  Chrono& operator=( const Chrono& ) = delete;
142  // =========================================================================
143 private:
144  // ==========================================================================
146  ChronoEntity* m_chrono = nullptr; // The actual chronometer
147  // ==========================================================================
148 };
149 // ============================================================================
150 // The END
151 // ============================================================================
152 #endif // GAUDIKERNEL_CHRONO_H
153 // ============================================================================
154 
155 
~Chrono()
Destructor , stop the chrono.
Definition: Chrono.h:135
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Definition: ChronoEntity.h:21
Chrono(Chrono &&rhs)
Move Constructor.
Definition: Chrono.h:59
A small utility class for chronometry of user codes.
Definition: Chrono.h:25
Chrono(ChronoEntity *c)
Constructor from Chrono Object/Entity.
Definition: Chrono.h:109
PropertyMgr & operator=(const PropertyMgr &)=delete
STL class.
Chrono(ChronoEntity &c)
Constructor from Chrono Object/Entity.
Definition: Chrono.h:132
start
Definition: IOTest.py:88
#define GAUDI_API
Definition: Kernel.h:107
"Chrono"-related part of interface IChronoStatSvc
Definition: IChronoSvc.h:31