1 #ifndef __GAUDI_CHRONOSTATSVC_STAT_H__ 2 #define __GAUDI_CHRONOSTATSVC_STAT_H__ 65 : m_entity( entity ), m_tag(
name ), m_group( group ) {}
81 : m_entity( &entity ), m_tag(
name ), m_group( group ) {}
122 Stat& operator=(
const Stat& ) =
default;
127 const StatEntity*
entity()
const {
return m_entity; }
131 operator const StatEntity&()
const {
return *entity(); }
152 if ( m_entity ) { ( *m_entity ) += f; }
169 if ( m_entity ) { ++( *m_entity ); }
185 if ( m_entity ) { ( *m_entity )++; }
194 if ( m_entity ) { ( *m_entity ) -= f; }
199 if ( m_entity ) { --( *m_entity ); }
204 if ( m_entity ) { ( *m_entity )--; }
209 if ( m_entity ) { ( *m_entity ) += right; }
214 if ( 0 != right.entity() ) { ( *this ) += *right.entity(); }
232 StatEntity*
counter()
const {
return m_entity; }
240 StatEntity* m_entity =
nullptr;
268 #endif // __GAUDI_CHRONOSTATSVC_STAT_H__
StatEntity * counter() const
alternative access to underlying counter
const StatEntity * entity() const
get the entity
Stat & operator-=(const double f)
General decrement operator for the counter.
Small wrapper class for easy manipulation with generic counters and IStatSvc interface.
SmartIF< IStatSvc > m_stat
Stat service.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
std::ostream & fillStream(std::ostream &o) const
printout to std::ostream
Stat & operator++(int)
Post-increment operator for the counter.
Stat & operator++()
Pre-increment operator for the counter.
Stat & operator+=(const double f)
General increment for the counter.
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Stat &stat)
external printout operator to std::ostream
Stat & operator--()
Pre-decrement operator for the flag.
std::string m_tag
unique stat tag(name)
const std::string & name() const
counter name
const StatEntity * operator->() const
dereference operaqtor
Stat(StatEntity *entity=0, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
Stat & operator--(int)
Post-decrement operator for the flag.
Stat(StatEntity &entity, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
Stat & operator+=(const StatEntity &right)
increment with StatEntity object
bool operator!() const
check validity
const std::string & group() const
counter group
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
Stat & operator+=(const Stat &right)
increment with other stat objects