Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface.
More...
#include <GaudiKernel/Stat.h>
List of all members.
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.
|
Detailed Description
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.Belyaev@lapp.in2p3.fr
- Date:
- 2007-08-02
Definition at line 50 of file Stat.h.
Constructor & Destructor Documentation
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.
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.
constructor from IStatSvc, tag and value
IStatSvc* svc = ... ;
double eTotal = .... ;
Stat eTot ( svc , "total energy" ) ;
eTot += eTotal ;
- See also:
- IStatSvc
- Parameters:
-
Definition at line 44 of file Stat.cpp.
constructor from IStatSvc, tag and value
IStatSvc* svc = ... ;
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.
| Stat::Stat |
( |
const Stat & |
right ) |
|
copy constructor
Definition at line 133 of file Stat.cpp.
Member Function Documentation
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.
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.
counter name
Definition at line 284 of file Stat.h.
| Stat::operator const StatEntity & |
( |
) |
const [inline] |
| bool Stat::operator! |
( |
) |
const [inline] |
check validity
Definition at line 175 of file Stat.h.
| Stat& Stat::operator++ |
( |
int |
) |
[inline] |
Post-increment operator for the counter.
Stat stat = ... ;
stat++ ;
- 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++ |
( |
) |
[inline] |
Pre-increment operator for the counter.
Stat stat = ... ;
++stat ;
- See also:
- StatEntity
- Returns:
- selfreference
Definition at line 211 of file Stat.h.
{
if ( 0 != m_entity ) { ++(*m_entity) ; }
return *this ;
}
| Stat& Stat::operator+= |
( |
const Stat & |
right ) |
[inline] |
increment with other stat objects
Definition at line 262 of file Stat.h.
{
if ( 0 != right.entity() ) { (*this) += *right.entity() ; }
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 double |
f ) |
[inline] |
General increment for the counter.
Stat stat = ... ;
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 ;
}
| 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-- |
( |
) |
[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-= |
( |
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 ;
}
| const StatEntity* Stat::operator-> |
( |
) |
const [inline] |
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.
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.
representation as string
Definition at line 178 of file Stat.cpp.
Member Data Documentation
underlying counter
Definition at line 290 of file Stat.h.
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_v23r2/GaudiKernel/GaudiKernel/Stat.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r2/GaudiKernel/src/Lib/Stat.cpp