3 #ifndef __GAUDI_CHRONOSTATSVC_STAT_H__
4 #define __GAUDI_CHRONOSTATSVC_STAT_H__
14 #include "GaudiKernel/StatEntity.h"
70 const std::string& name =
"" ,
71 const std::string& group =
"" )
93 const std::string& name =
"" ,
94 const std::string& group =
"" )
95 : m_entity ( &entity )
120 const std::string& tag ) ;
139 const std::string& tag ,
140 const double flag ) ;
159 const std::string& group ,
160 const std::string& name ) ;
164 Stat& operator=(
const Stat& right) ;
169 const StatEntity* entity ()
const {
return m_entity ; }
171 const StatEntity* operator->()
const {
return entity() ; }
173 operator const StatEntity& ()
const {
return *entity() ; }
175 bool operator!()
const {
return 0 == m_entity ; }
193 Stat& operator+= (
const double f )
195 if ( 0 != m_entity ) { (*m_entity) += f ; }
213 if ( 0 != m_entity ) { ++(*m_entity) ; }
228 Stat& operator++ (
int)
230 if ( 0 != m_entity ) { (*m_entity)++ ; }
238 Stat& operator-= (
const double f )
240 if ( 0 != m_entity ) { (*m_entity) -= f ; }
246 if ( 0 != m_entity ) { --(*m_entity) ; }
250 Stat& operator-- (
int)
252 if ( 0 != m_entity ) { (*m_entity)-- ; }
258 if ( 0 != m_entity ) { (*m_entity) += right ; }
262 Stat& operator+=(
const Stat& right )
264 if ( 0 != right.
entity() ) { (*this) += *right.
entity() ; }
274 std::ostream& print( std::ostream& o = std::cout )
const ;
279 std::ostream& fillStream ( std::ostream& o )
const {
return print ( o ) ; }
282 StatEntity* counter ()
const {
return m_entity ; }
284 const std::string& name ()
const {
return m_tag ; }
286 const std::string& group ()
const {
return m_group ; }
294 std::string m_group ;
320 #endif // __GAUDI_CHRONOSTATSVC_STAT_H__
GAUDI_API Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
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
const StatEntity * entity() const
get the entity
"Stat"-related part of interface IChronoStatSvc
bool operator!(const Gaudi::Time &t)
The basic counter used for Monitoring purposes.
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Stat &stat)
external printout operator to std::ostream