#include <GaudiKernel/Stat.h>
Collaboration diagram for Stat:
Public Member Functions | |
Stat (StatEntity *entity=0, const std::string &name="", const std::string &group="") | |
constructor from StatEntity, name and group : | |
Stat (StatEntity &entity, const std::string &name="", const std::string &group="") | |
constructor from StatEntity, name and group : | |
Stat (IStatSvc *svc, const std::string &tag) | |
constructor from IStatSvc, tag and value | |
Stat (IStatSvc *svc, const std::string &tag, const double flag) | |
constructor from IStatSvc, tag and value | |
Stat (ICounterSvc *svc, const std::string &group, const std::string &name) | |
constructor from ICounterSvc, group and name | |
Stat (const Stat &right) | |
copy constructor | |
Stat & | operator= (const Stat &right) |
Assignement operator. | |
~Stat () | |
destructor | |
const StatEntity * | entity () const |
get the entity | |
const StatEntity * | operator-> () const |
dereference operaqtor | |
operator const StatEntity & () const | |
cast to StatEntity | |
bool | operator! () const |
check validity | |
Stat & | operator+= (const double f) |
General increment for the counter. | |
Stat & | operator++ () |
Pre-increment operator for the counter. | |
Stat & | operator++ (int) |
Post-increment operator for the counter. | |
Stat & | operator-= (const double f) |
General decrement operator for the counter. | |
Stat & | operator-- () |
Pre-decrement operator for the flag. | |
Stat & | operator-- (int) |
Post-decrement operator for the flag. | |
Stat & | operator+= (const StatEntity &right) |
increment with StatEntity object | |
Stat & | operator+= (const Stat &right) |
increment with other stat objects | |
std::string | toString () const |
representation as string | |
std::ostream & | print (std::ostream &o=std::cout) const |
printout to std::ostream | |
std::ostream & | fillStream (std::ostream &o) const |
printout to std::ostream | |
StatEntity * | counter () const |
alternative access to underlying counter (for ICounterSvc::CounterObj) | |
const std::string & | name () const |
counter name | |
const std::string & | group () const |
counter group (for ICounterSvc) | |
Private Attributes | |
StatEntity * | m_entity |
underlying counter | |
std::string | m_tag |
unique stat tag(name) | |
std::string | m_group |
IStatSvc * | m_stat |
Stat service. | |
ICounterSvc * | m_counter |
Counter Service. |
It acts as "smart pointer" fro StatEntity objects, and allows manipulation with StatEntity objects, owned by GaudiCommon<TYPE> base class and/or IStatSvc/ICounterSvc
long nTracks = ... ; Stat stat( chronoSvc() , "#tracks" , nTracks ) ;
Alternatively one can use operator methods:
long nTracks = ... ; Stat stat( chronoSvc() , "#tracks" ) ; stat += nTracks ;
Definition at line 50 of file Stat.h.
Stat::Stat | ( | StatEntity * | entity = 0 , |
|
const std::string & | name = "" , |
|||
const std::string & | group = "" | |||
) | [inline] |
constructor from StatEntity, name and group :
StatEntity* entity = ... ; // make helper object: Stat stat ( entity ) ;
entity | pointer to entity object | |
name | (optional) name of the object, for printout | |
group | (optional) group of the object, for printout |
Definition at line 69 of file Stat.h.
00072 : m_entity ( entity ) 00073 , m_tag ( name ) 00074 , m_group ( group ) 00075 , m_stat ( 0 ) 00076 , m_counter ( 0 ) 00077 {}
Stat::Stat | ( | StatEntity & | entity, | |
const std::string & | name = "" , |
|||
const std::string & | group = "" | |||
) | [inline] |
constructor from StatEntity, name and group :
GaudiCommon::counter
entity | reference to entity object | |
name | (optional) name of the object, for printout | |
group | (optional) group of the object, for printout |
Definition at line 92 of file Stat.h.
00095 : m_entity ( &entity ) 00096 , m_tag ( name ) 00097 , m_group ( group ) 00098 , m_stat ( 0 ) 00099 , m_counter ( 0 ) 00100 {}
Stat::Stat | ( | IStatSvc * | svc, | |
const std::string & | tag | |||
) |
Stat::Stat | ( | IStatSvc * | svc, | |
const std::string & | tag, | |||
const double | flag | |||
) |
Stat::Stat | ( | ICounterSvc * | svc, | |
const std::string & | group, | |||
const std::string & | name | |||
) |
constructor from ICounterSvc, group and name
ICounterSvc* svc = ... ; // get/create the counter from Counter Service Stat stat( svc , "ECAL" , "TotalEnergy" ) ;
svc | pointer to Counter Service | |
group | group name | |
name | counter name |
Stat::Stat | ( | const Stat & | right | ) |
copy constructor
Stat::~Stat | ( | ) |
destructor
const StatEntity* Stat::entity | ( | ) | const [inline] |
const StatEntity* Stat::operator-> | ( | ) | const [inline] |
Stat::operator const StatEntity & | ( | ) | const [inline] |
bool Stat::operator! | ( | ) | const [inline] |
Stat& Stat::operator+= | ( | const double | f | ) | [inline] |
General increment for the counter.
Stat stat = ... ; const long nTracks = ... ; stat += nTracks ;
f | value to be added to the counter |
Definition at line 193 of file Stat.h.
00194 { 00195 if ( 0 != m_entity ) { (*m_entity) += f ; } 00196 return *this ; 00197 }
Stat& Stat::operator++ | ( | ) | [inline] |
Pre-increment operator for the counter.
Stat stat = ... ; ++stat ;
Definition at line 211 of file Stat.h.
00212 { 00213 if ( 0 != m_entity ) { ++(*m_entity) ; } 00214 return *this ; 00215 }
Stat& Stat::operator++ | ( | int | ) | [inline] |
Post-increment operator for the counter.
Stat stat = ... ; stat++ ;
Definition at line 228 of file Stat.h.
00229 { 00230 if ( 0 != m_entity ) { (*m_entity)++ ; } 00231 return *this ; 00232 }
Stat& Stat::operator-= | ( | const double | f | ) | [inline] |
General decrement operator for the counter.
f | counter decrement |
Definition at line 238 of file Stat.h.
00239 { 00240 if ( 0 != m_entity ) { (*m_entity) -= f ; } 00241 return *this ; 00242 }
Stat& Stat::operator-- | ( | ) | [inline] |
Stat& Stat::operator-- | ( | int | ) | [inline] |
Stat& Stat::operator+= | ( | const StatEntity & | right | ) | [inline] |
increment with StatEntity object
Definition at line 256 of file Stat.h.
00257 { 00258 if ( 0 != m_entity ) { (*m_entity) += right ; } 00259 return *this ; 00260 }
std::string Stat::toString | ( | ) | const |
representation as string
std::ostream& Stat::print | ( | std::ostream & | o = std::cout |
) | const |
printout to std::ostream
s | the reference to the output stream |
std::ostream& Stat::fillStream | ( | std::ostream & | o | ) | const [inline] |
StatEntity* Stat::counter | ( | ) | const [inline] |
const std::string& Stat::name | ( | ) | const [inline] |
const std::string& Stat::group | ( | ) | const [inline] |
StatEntity* Stat::m_entity [private] |
std::string Stat::m_tag [private] |
std::string Stat::m_group [private] |
IStatSvc* Stat::m_stat [private] |
ICounterSvc* Stat::m_counter [private] |