The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
Chrono.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
GaudiKernel/ChronoEntity.h
>
14
#include <
GaudiKernel/IChronoSvc.h
>
15
#include <
GaudiKernel/Kernel.h
>
16
#include <string>
17
27
class
GAUDI_API
Chrono
{
28
public
:
50
Chrono
(
IChronoSvc
* svc =
nullptr
,
// the service
51
const
std::string& tag =
"CHRONO::UNNAMED"
)
// the unique tag/name
52
{
53
if
( svc ) {
m_chrono
= svc->chronoStart( tag ); }
54
}
55
56
Chrono
(
Chrono
&& rhs ) {
57
m_chrono
= rhs.m_chrono;
58
rhs.m_chrono =
nullptr
;
59
}
60
82
Chrono
(
const
std::string& tag,
// the unique tag/name
83
IChronoSvc
* svc )
// the service
84
{
85
if
( svc ) {
m_chrono
= svc->
chronoStart
( tag ); }
86
}
87
108
Chrono
(
ChronoEntity
* c ) :
m_chrono
( c ) {
109
if
(
m_chrono
) {
m_chrono
->start(); }
110
}
111
132
Chrono
(
ChronoEntity
& c ) :
m_chrono
( &c ) {
m_chrono
->start(); }
133
135
~Chrono
() {
136
if
(
m_chrono
) {
m_chrono
->stop(); }
137
}
138
139
private
:
140
Chrono
(
const
Chrono
& ) =
delete
;
141
Chrono
&
operator=
(
const
Chrono
& ) =
delete
;
142
144
ChronoEntity
*
m_chrono
=
nullptr
;
// The actual chronometer
145
};
ChronoEntity.h
IChronoSvc.h
Kernel.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
ChronoEntity
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Definition
ChronoEntity.h:26
Chrono::Chrono
Chrono(ChronoEntity *c)
Constructor from Chrono Object/Entity.
Definition
Chrono.h:108
Chrono::Chrono
Chrono(const Chrono &)=delete
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition
Chrono.h:144
Chrono::Chrono
Chrono(Chrono &&rhs)
Definition
Chrono.h:56
Chrono::operator=
Chrono & operator=(const Chrono &)=delete
Chrono::~Chrono
~Chrono()
Destructor , stop the chrono.
Definition
Chrono.h:135
Chrono::Chrono
Chrono(const std::string &tag, IChronoSvc *svc)
Constructor from Chrono Service and the tag.
Definition
Chrono.h:82
Chrono::Chrono
Chrono(ChronoEntity &c)
Constructor from Chrono Object/Entity.
Definition
Chrono.h:132
Chrono::Chrono
Chrono(IChronoSvc *svc=nullptr, const std::string &tag="CHRONO::UNNAMED")
Constructor from Chrono Service and the tag.
Definition
Chrono.h:50
IChronoSvc
"Chrono"-related part of interface IChronoStatSvc
Definition
IChronoSvc.h:31
IChronoSvc::chronoStart
virtual ChronoEntity * chronoStart(const ChronoTag &t)=0
start chrono, tagged by its name
GaudiKernel
include
GaudiKernel
Chrono.h
Generated on
for The Gaudi Framework by
1.17.0