3 #ifndef __GAUDI_CHRONOSTATSVC_STAT_H__
4 #define __GAUDI_CHRONOSTATSVC_STAT_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) ;
193 Stat& operator+= (
const double f )
195 if ( 0 != m_entity ) { (*m_entity) += f ; }
213 if ( 0 != m_entity ) { ++(*m_entity) ; }
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) ; }
252 if ( 0 != m_entity ) { (*m_entity)-- ; }
258 if ( 0 != m_entity ) { (*m_entity) += 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 ) ; }
284 const std::string&
name ()
const {
return m_tag ; }
286 const std::string&
group ()
const {
return m_group ; }
320 #endif // __GAUDI_CHRONOSTATSVC_STAT_H__
bool operator!() const
check validity
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)
StatEntity * m_entity
underlying counter
const std::string & name() const
counter name
std::ostream & fillStream(std::ostream &o) const
printout to std::ostream
ICounterSvc * m_counter
Counter Service.
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Stat &stat)
external printout operator to std::ostream
std::string m_tag
unique stat tag(name)
Stat(StatEntity *entity=0, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
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
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
"Stat"-related part of interface IChronoStatSvc
The basic counter used for Monitoring purposes.
Stat & operator+=(const Stat &right)
increment with other stat objects
const std::string & group() const
counter group (for ICounterSvc)