The Gaudi Framework
v29r0 (ff2e7097)
|
Create / access multi purpose counters. More...
#include <GaudiKernel/ICounterSvc.h>
Classes | |
class | Printout |
Print counters for each element in the range [first, last) e.g. More... | |
Public Types | |
enum | { COUNTER_NOT_PRESENT = 2, COUNTER_EXISTS = 4, COUNTER_REMOVED = 3 } |
typedef StatEntity | Counter |
the actual type of counter More... | |
typedef Stat | CountObject |
Ease the manipulation of counters in a way, that they behave like objects: Avoid: Counter* cnt = ...; ++(*cnt);. More... | |
typedef std::vector< CountObject > | Counters |
the actual type of vectors of initialized counters More... | |
Public Types inherited from IInterface | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
using | iid = Gaudi::InterfaceId< IInterface, 0, 0 > |
Interface ID. More... | |
using | ext_iids = Gaudi::interface_list< iid > |
Extra interfaces. More... | |
Public Member Functions | |
DeclareInterfaceID (ICounterSvc, 4, 0) | |
InterfaceID. More... | |
virtual Counter * | get (const std::string &group, const std::string &name) const =0 |
Access an existing counter object. More... | |
virtual Counters | get (const std::string &group) const =0 |
get all counters form the given group: More... | |
virtual StatusCode | create (const std::string &group, const std::string &name, longlong initial_value, Counter *&refpCounter)=0 |
Create a new counter object. More... | |
virtual CountObject | create (const std::string &group, const std::string &name, longlong initial_value=0)=0 |
If the counter object exists already, a std::runtime_error exception is thrown. More... | |
virtual StatusCode | remove (const std::string &group, const std::string &name)=0 |
Remove a counter object. More... | |
virtual StatusCode | remove (const std::string &group)=0 |
Remove all counters of a given group. More... | |
virtual StatusCode | print (const std::string &group, const std::string &name, Printout &printer) const =0 |
Print counter value. More... | |
virtual StatusCode | print (const std::string &group, Printout &printer) const =0 |
If no such counter exists the return code is COUNTER_NOT_PRESENT Note: This call is not direct access. More... | |
virtual StatusCode | print (const Counter *pCounter, Printout &printer) const =0 |
Print counter value. More... | |
virtual StatusCode | print (const CountObject &pCounter, Printout &printer) const =0 |
Print counter value. More... | |
virtual StatusCode | print (Printout &printer) const =0 |
virtual StatusCode | defaultPrintout (MsgStream &log, const Counter *pCounter) const =0 |
Default Printout for counters. More... | |
Public Member Functions inherited from IInterface | |
virtual void * | i_cast (const InterfaceID &) const =0 |
main cast function More... | |
virtual std::vector< std::string > | getInterfaceNames () const =0 |
Returns a vector of strings containing the names of all the implemented interfaces. More... | |
virtual unsigned long | addRef ()=0 |
Increment the reference count of Interface instance. More... | |
virtual unsigned long | release ()=0 |
Release Interface instance. More... | |
virtual unsigned long | refCount () const =0 |
Current reference count. More... | |
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp)=0 |
Set the void** to the pointer to the requested interface of the instance. More... | |
virtual | ~IInterface ()=default |
Virtual destructor. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IInterface | |
static const InterfaceID & | interfaceID () |
Return an instance of InterfaceID identifying the interface. More... | |
Create / access multi purpose counters.
Definition at line 75 of file ICounterSvc.h.
typedef StatEntity ICounterSvc::Counter |
typedef std::vector<CountObject> ICounterSvc::Counters |
the actual type of vectors of initialized counters
Definition at line 99 of file ICounterSvc.h.
typedef Stat ICounterSvc::CountObject |
Ease the manipulation of counters in a way, that they behave like objects: Avoid: Counter* cnt = ...; ++(*cnt);.
Instead: Counter* cnt = ...; CountObject obj(cnt); ++cnt;
Note: No inheritance! This class has no virtual destructor
Definition at line 97 of file ICounterSvc.h.
anonymous enum |
Enumerator | |
---|---|
COUNTER_NOT_PRESENT | |
COUNTER_EXISTS | |
COUNTER_REMOVED |
Definition at line 226 of file ICounterSvc.h.
|
pure virtual |
Create a new counter object.
If the counter object exists already the existing object is returned. In this event the return code is COUNTER_EXISTS. The ownership of the actual counter stays with the service.
group | [IN] Hint for smart printing |
name | [IN] Counter name |
initial_value | [IN] Initial counter value |
refpCounter | [OUT] Reference to store pointer to counter. |
|
pure virtual |
If the counter object exists already, a std::runtime_error exception is thrown.
The ownership of the actual counter stays with the service.
group | [IN] Hint for smart printing |
name | [IN] Counter name |
initial_value | [IN] Initial counter value |
refpCounter | [OUT] Reference to store pointer to counter. |
ICounterSvc::DeclareInterfaceID | ( | ICounterSvc | , |
4 | , | ||
0 | |||
) |
|
pure virtual |
Default Printout for counters.
|
pure virtual |
Access an existing counter object.
group | [IN] Hint for smart printing |
name | [IN] Counter name |
createIf | [IN] flag to indicate the creation if not counter found |
|
pure virtual |
get all counters form the given group:
gorup | the gorup name |
|
pure virtual |
Print counter value.
group | [IN] Hint for smart printing |
name | [IN] Counter name |
printer | [IN] Print actor |
|
pure virtual |
If no such counter exists the return code is COUNTER_NOT_PRESENT Note: This call is not direct access.
group | [IN] Hint for smart printing |
printer | [IN] Print actor |
|
pure virtual |
Print counter value.
pCounter | [IN] Pointer to Counter object |
printer | [IN] Print actor |
|
pure virtual |
Print counter value.
refCounter | [IN] Reference to CountObject object |
printer | [IN] Print actor |
|
pure virtual |
printer | [IN] Print actor |
|
pure virtual |
Remove a counter object.
If the counter object does not exists, the return code is COUNTER_NOT_PRESENT. The counter may not be used anymore after this call.
group | [IN] Hint for smart printing |
name | [IN] Counter name |
initial_value | [IN] Initial counter value |
refpCounter | [OUT] Reference to store pointer to counter. |
|
pure virtual |
Remove all counters of a given group.
If no such counter exists the return code is COUNTER_NOT_PRESENT
group | [IN] Hint for smart printing |