1 #ifndef __GAUDI_CHRONOSTATSVC_STAT_H__
2 #define __GAUDI_CHRONOSTATSVC_STAT_H__
12 #include "GaudiKernel/ICounterSvc.h"
13 #include "GaudiKernel/StatEntity.h"
14 #include "GaudiKernel/SmartIF.h"
15 #include "GaudiKernel/IStatSvc.h"
66 const std::string&
name =
"" ,
67 const std::string& group =
"" )
88 const std::string&
name =
"" ,
89 const std::string& group =
"" )
90 : m_entity ( &entity )
114 const std::string& tag ) ;
133 const std::string& tag ,
134 const double flag ) ;
153 const std::string& group ,
154 const std::string&
name ) ;
158 Stat& operator=(
const Stat& ) =
default;
163 const StatEntity* entity ()
const {
return m_entity ; }
165 const StatEntity* operator->()
const {
return entity() ; }
167 operator const StatEntity& ()
const {
return *entity() ; }
169 bool operator!()
const {
return 0 == m_entity ; }
187 Stat& operator+= (
const double f )
189 if ( m_entity ) { (*m_entity) += f ; }
207 if ( m_entity ) { ++(*m_entity) ; }
222 Stat& operator++ (
int)
224 if ( m_entity ) { (*m_entity)++ ; }
232 Stat& operator-= (
const double f )
234 if ( m_entity ) { (*m_entity) -= f ; }
240 if ( m_entity ) { --(*m_entity) ; }
244 Stat& operator-- (
int)
246 if ( m_entity ) { (*m_entity)-- ; }
252 if ( m_entity ) { (*m_entity) += right ; }
256 Stat& operator+=(
const Stat& right )
258 if ( 0 != right.
entity() ) { (*this) += *right.
entity() ; }
268 std::ostream&
print( std::ostream& o = std::cout )
const ;
273 std::ostream& fillStream ( std::ostream& o )
const {
return print ( o ) ; }
278 const std::string&
name ()
const {
return m_tag ; }
280 const std::string& group ()
const {
return m_group ; }
288 std::string m_group ;
314 #endif // __GAUDI_CHRONOSTATSVC_STAT_H__
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Stat &stat)
external printout operator to std::ostream
Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface...
Create / access multi purpose counters.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
GAUDI_API Stat operator+(const Stat &stat, const double value)
external operator for addition of Stat and a number
GAUDI_API Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
const StatEntity * entity() const
get the entity
bool operator!(const Gaudi::Time &t)
"Stat"-related part of interface IChronoStatSvc
The basic counter used for Monitoring purposes.