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;
187 Stat& operator+= (
const double f )
189 if ( m_entity ) { (*m_entity) += f ; }
207 if ( m_entity ) { ++(*m_entity) ; }
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) ; }
246 if ( m_entity ) { (*m_entity)-- ; }
252 if ( m_entity ) { (*m_entity) += 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 ; }
314 #endif // __GAUDI_CHRONOSTATSVC_STAT_H__
bool operator!() const
check validity
GAUDI_API Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
SmartIF< ICounterSvc > m_counter
Counter Service.
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
StatEntity * counter() const
alternative access to underlying counter (for ICounterSvc::CounterObj)
const std::string & name() const
counter name
std::ostream & fillStream(std::ostream &o) const
printout to std::ostream
std::string m_tag
unique stat tag(name)
GAUDI_API Stat operator+(const Stat &stat, const double value)
external operator for addition of Stat and a number
Stat(StatEntity *entity=0, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
SmartIF< IStatSvc > m_stat
Stat service.
Stat(StatEntity &entity, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
const StatEntity * operator->() const
dereference operaqtor
const StatEntity * entity() const
get the entity
Stat & operator+=(const StatEntity &right)
increment with StatEntity object
"Stat"-related part of interface IChronoStatSvc
The basic counter used for Monitoring purposes.
Stat & operator+=(const Stat &right)
increment with other stat objects
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Stat &stat)
external printout operator to std::ostream
const std::string & group() const
counter group (for ICounterSvc)