Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface.
More...
#include <GaudiKernel/Stat.h>
|
| | 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)
|
| |
Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface.
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 ;
- Author
- Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
- Date
- 2007-08-02
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 :
- See Also
- StatEntity
- Parameters
-
| 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.
| Stat::Stat |
( |
StatEntity & |
entity, |
|
|
const std::string & |
name = "", |
|
|
const std::string & |
group = "" |
|
) |
| |
|
inline |
constructor from StatEntity, name and group :
Stat stat =
Stat( countter(
"Name") ,
"Name" ) ;
- See Also
- StatEntity
-
GaudiCommon::counter
- Parameters
-
| 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.
| Stat::Stat |
( |
IStatSvc * |
svc, |
|
|
const std::string & |
tag |
|
) |
| |
constructor from IStatSvc, tag and value
double eTotal = .... ;
Stat eTot ( svc ,
"total energy" ) ;
eTot += eTotal ;
- See Also
- IStatSvc
- Parameters
-
Definition at line 44 of file Stat.cpp.
{
{
if ( 0 == tmp )
{
}
}
}
| Stat::Stat |
( |
IStatSvc * |
svc, |
|
|
const std::string & |
tag, |
|
|
const double |
flag |
|
) |
| |
constructor from IStatSvc, tag and value
double eTotal = .... ;
Stat stat( svc ,
"total energy" , eTotal ) ;
- See Also
- IStatSvc
- Parameters
-
| svc | pointer to Chrono&Stat Service tag unique tag for the entry |
| flag | "flag"(additive quantity) to be used |
Definition at line 86 of file Stat.cpp.
{
{
m_stat -> stat( tag , flag ) ;
}
}
| Stat::Stat |
( |
ICounterSvc * |
svc, |
|
|
const std::string & |
group, |
|
|
const std::string & |
name |
|
) |
| |
| Stat::Stat |
( |
const Stat & |
right | ) |
|
copy constructor
Definition at line 133 of file Stat.cpp.
alternative access to underlying counter (for ICounterSvc::CounterObj)
Definition at line 282 of file Stat.h.
get the entity
Definition at line 169 of file Stat.h.
| std::ostream& Stat::fillStream |
( |
std::ostream & |
o | ) |
const |
|
inline |
printout to std::ostream
- Parameters
-
| s | the reference to the output stream |
- Returns
- the reference to the output stream
Definition at line 279 of file Stat.h.
| const std::string& Stat::group |
( |
| ) |
const |
|
inline |
| const std::string& Stat::name |
( |
| ) |
const |
|
inline |
counter name
Definition at line 284 of file Stat.h.
| bool Stat::operator! |
( |
| ) |
const |
|
inline |
check validity
Definition at line 175 of file Stat.h.
| Stat& Stat::operator++ |
( |
| ) |
|
|
inline |
Pre-increment operator for the counter.
- See Also
- StatEntity
- Returns
- selfreference
Definition at line 211 of file Stat.h.
{
if ( 0 !=
m_entity ) { ++(*m_entity) ; }
return *this ;
}
| Stat& Stat::operator++ |
( |
int |
| ) |
|
|
inline |
Post-increment operator for the counter.
- See Also
- StatEntity
- Returns
- self-reference
Definition at line 228 of file Stat.h.
{
if ( 0 !=
m_entity ) { (*m_entity)++ ; }
return *this ;
}
| Stat& Stat::operator+= |
( |
const double |
f | ) |
|
|
inline |
General increment for the counter.
const long nTracks = ... ;
stat += nTracks ;
- See Also
- StatEntity
- Parameters
-
| f | value to be added to the counter |
- Returns
- selfreference
Definition at line 193 of file Stat.h.
{
if ( 0 !=
m_entity ) { (*m_entity) += f ; }
return *this ;
}
increment with StatEntity object
Definition at line 256 of file Stat.h.
{
if ( 0 !=
m_entity ) { (*m_entity) += right ; }
return *this ;
}
| Stat& Stat::operator+= |
( |
const Stat & |
right | ) |
|
|
inline |
increment with other stat objects
Definition at line 262 of file Stat.h.
| Stat& Stat::operator-- |
( |
| ) |
|
|
inline |
Pre-decrement operator for the flag.
Definition at line 244 of file Stat.h.
{
if ( 0 !=
m_entity ) { --(*m_entity) ; }
return *this ;
}
| Stat& Stat::operator-- |
( |
int |
| ) |
|
|
inline |
Post-decrement operator for the flag.
Definition at line 250 of file Stat.h.
{
if ( 0 !=
m_entity ) { (*m_entity)-- ; }
return *this ;
}
| Stat& Stat::operator-= |
( |
const double |
f | ) |
|
|
inline |
General decrement operator for the counter.
- See Also
- StatEntity
- Returns
- self-reference
- Parameters
-
Definition at line 238 of file Stat.h.
{
if ( 0 !=
m_entity ) { (*m_entity) -= f ; }
return *this ;
}
dereference operaqtor
Definition at line 171 of file Stat.h.
| Stat & Stat::operator= |
( |
const Stat & |
right | ) |
|
Assignement operator.
Definition at line 146 of file Stat.cpp.
{
if ( this == &right ) { return *this ; }
{
if ( 0 != stat ) { stat -> addRef() ; }
}
{
if ( 0 != counter ) { counter -> addRef() ; }
}
return *this ;
}
| std::ostream & Stat::print |
( |
std::ostream & |
o = std::cout | ) |
const |
printout to std::ostream
- Parameters
-
| s | the reference to the output stream |
- Returns
- the reference to the output stream
Definition at line 189 of file Stat.cpp.
{
{
{
}
else
{
}
}
{
}
% (
"\"" +
m_tag +
"\"" ) ;
}
| std::string Stat::toString |
( |
| ) |
const |
representation as string
Definition at line 178 of file Stat.cpp.
{
std::ostringstream ost ;
return ost.str () ;
}
underlying counter
Definition at line 290 of file Stat.h.
| std::string Stat::m_group |
|
private |
unique stat tag(name)
Definition at line 292 of file Stat.h.
The documentation for this class was generated from the following files:
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r2/GaudiKernel/GaudiKernel/Stat.h
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r2/GaudiKernel/src/Lib/Stat.cpp