The Gaudi Framework  v31r0 (aeb156f0)
Chrono Class Reference

A small utility class for chronometry of user codes. More...

#include <GaudiKernel/Chrono.h>

Collaboration diagram for Chrono:

Public Member Functions

 Chrono (IChronoSvc *svc=nullptr, const std::string &tag="CHRONO::UNNAMED")
 Constructor from Chrono Service and the tag. More...
 
 Chrono (Chrono &&rhs)
 Move Constructor. More...
 
 Chrono (const std::string &tag, IChronoSvc *svc)
 Constructor from Chrono Service and the tag. More...
 
 Chrono (ChronoEntity *c)
 Constructor from Chrono Object/Entity. More...
 
 Chrono (ChronoEntity &c)
 Constructor from Chrono Object/Entity. More...
 
 ~Chrono ()
 Destructor , stop the chrono. More...
 

Private Member Functions

 Chrono (const Chrono &)=delete
 delete the copy constructor and assignment operators More...
 
Chronooperator= (const Chrono &)=delete
 

Private Attributes

ChronoEntitym_chrono = nullptr
 The actual chronometer. More...
 

Detailed Description

A small utility class for chronometry of user codes.

See also
ChronoEntity
IChronoSvc
Author
Vanya Belyaev
Date
Nov 26, 1999

Definition at line 25 of file Chrono.h.

Constructor & Destructor Documentation

Chrono::Chrono ( IChronoSvc svc = nullptr,
const std::string tag = "CHRONO::UNNAMED" 
)
inline

Constructor from Chrono Service and the tag.

IChronoSvc* svc = ... ;
{ // start the scope
Chrono chrono ( svc , "some unique tag here" ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Parameters
svcpointer to Chrono Service
tagthe unique tag

Definition at line 49 of file Chrono.h.

51  {
52  if ( svc ) { m_chrono = svc->chronoStart( tag ); }
53  }
virtual ChronoEntity * chronoStart(const ChronoTag &t)=0
start chrono, tagged by its name
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:152
Chrono::Chrono ( Chrono &&  rhs)
inline

Move Constructor.

Definition at line 59 of file Chrono.h.

59  {
60  m_chrono = rhs.m_chrono;
61  rhs.m_chrono = nullptr;
62  }
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:152
Chrono::Chrono ( const std::string tag,
IChronoSvc svc 
)
inline

Constructor from Chrono Service and the tag.

IChronoSvc* svc = ... ;
{ // start the scope
Chrono chrono ( "some unique tag here" , svc ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Parameters
tagthe unique tag
svcpointer to Chrono Service

Definition at line 86 of file Chrono.h.

88  {
89  if ( svc ) { m_chrono = svc->chronoStart( tag ); }
90  }
virtual ChronoEntity * chronoStart(const ChronoTag &t)=0
start chrono, tagged by its name
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:152
Chrono::Chrono ( ChronoEntity c)
inline

Constructor from Chrono Object/Entity.

ChronoEntity* chronometer = ... ;
{ // start the scope
Chrono chrono ( chronometer ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Parameters
cthe pointer to Chrono Object/Entity

Definition at line 112 of file Chrono.h.

112  : m_chrono( c ) {
113  if ( m_chrono ) { m_chrono->start(); }
114  }
IChronoSvc::ChronoStatus start()
start the current chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:152
Chrono::Chrono ( ChronoEntity c)
inline

Constructor from Chrono Object/Entity.

{ // start the scope
Chrono chrono ( m_chrono ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Parameters
cthe reference to Chrono Object/Entity

Definition at line 136 of file Chrono.h.

136 : m_chrono( &c ) { m_chrono->start(); }
IChronoSvc::ChronoStatus start()
start the current chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:152
Chrono::~Chrono ( )
inline

Destructor , stop the chrono.

Definition at line 139 of file Chrono.h.

139  {
140  if ( m_chrono ) { m_chrono->stop(); }
141  }
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:152
IChronoSvc::ChronoStatus stop()
stop the chrono
Chrono::Chrono ( const Chrono )
privatedelete

delete the copy constructor and assignment operators

Member Function Documentation

Chrono& Chrono::operator= ( const Chrono )
privatedelete

Member Data Documentation

ChronoEntity* Chrono::m_chrono = nullptr
private

The actual chronometer.

Definition at line 152 of file Chrono.h.


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