| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ICounterSvc.h
Go to the documentation of this file.
1 // ============================================================================
2 #ifndef GAUDIKERNEL_ICOUNTERSVC_H
3 #define GAUDIKERNEL_ICOUNTERSVC_H
4 // ============================================================================
5 // Include files
6 // ============================================================================
7 // STD & STL
8 // ============================================================================
9 #include <string>
10 #include <vector>
11 // ============================================================================
12 // GaudiKernel
13 // ============================================================================
14 #include "GaudiKernel/IInterface.h"
15 #include "GaudiKernel/SmartIF.h"
16 #include "GaudiKernel/StatEntity.h"
17 // ============================================================================
18 // Forward declarations
19 // ============================================================================
20 class MsgStream;
21 class StatEntity;
22 class Stat;
23 // ============================================================================
75 class GAUDI_API ICounterSvc : virtual public IInterface
76 {
77 public:
79 DeclareInterfaceID( ICounterSvc, 4, 0 );
81 typedef StatEntity Counter;
97 typedef Stat CountObject;
99 typedef std::vector<CountObject> Counters;
108 class Printout final
109 {
110 public:
112 Printout( ICounterSvc* svc );
114 StatusCode operator()( MsgStream& log, const Counter* cnt ) const;
115
116 // no default,copy constructor, assignment
117 Printout() = delete;
118 Printout( const Printout& ) = delete; //< no copy constructor
119 Printout& operator=( const Printout& ) = delete;
120 private:
122 SmartIF<ICounterSvc> m_svc;
123 };
132 virtual Counter* get( const std::string& group, const std::string& name ) const = 0;
151 virtual Counters get( const std::string& group ) const = 0;
164 virtual StatusCode create( const std::string& group, const std::string& name, longlong initial_value,
165 Counter*& refpCounter ) = 0;
175 virtual CountObject create( const std::string& group, const std::string& name, longlong initial_value = 0 ) = 0;
185 virtual StatusCode remove( const std::string& group, const std::string& name ) = 0;
191 virtual StatusCode remove( const std::string& group ) = 0;
199 virtual StatusCode print( const std::string& group, const std::string& name, Printout& printer ) const = 0;
206 virtual StatusCode print( const std::string& group, Printout& printer ) const = 0;
212 virtual StatusCode print( const Counter* pCounter, Printout& printer ) const = 0;
218 virtual StatusCode print( const CountObject& pCounter, Printout& printer ) const = 0;
222 virtual StatusCode print( Printout& printer ) const = 0;
224 virtual StatusCode defaultPrintout( MsgStream& log, const Counter* pCounter ) const = 0;
225 // Return codes:
226 enum {
227 COUNTER_NOT_PRESENT = 2, // Error
228 COUNTER_EXISTS = 4, // Error ?
229 COUNTER_REMOVED = 3 // Type of success. Low bit set
230 };
231 };
232 // ============================================================================
234 // ============================================================================
235 std::ostream& operator<<( std::ostream&, const ICounterSvc::CountObject& );
236 // ============================================================================
238 // ============================================================================
239 #endif // GAUDIKERNEL_ICOUNTERSVC_H
240 // ============================================================================
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< ICounterSvc >
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
Stat
Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface...
Definition: Stat.h:46
ICounterSvc
Create / access multi purpose counters.
Definition: ICounterSvc.h:75
ICounterSvc::Printout::m_svc
SmartIF< ICounterSvc > m_svc
Reference to counter service.
Definition: ICounterSvc.h:122
ICounterSvc::Counters
std::vector< CountObject > Counters
the actual type of vectors of initialized counters
Definition: ICounterSvc.h:99
ICounterSvc::Counter
StatEntity Counter
the actual type of counter
Definition: ICounterSvc.h:81
operator=
PropertyMgr & operator=(const PropertyMgr &)=delete
std::string
STL class.
__longlong
Definition: Kernel.h:56
ICounterSvc::Printout
Print counters for each element in the range [first, last) e.g.
Definition: ICounterSvc.h:108
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DeclareInterfaceID
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:13
IInterface
Definition of the basic interface.
Definition: IInterface.h:277
SmartIF.h
ICounterSvc::CountObject
Stat CountObject
Ease the manipulation of counters in a way, that they behave like objects: Avoid: Counter* cnt = ...
Definition: ICounterSvc.h:97
std::vector
STL class.
Gaudi::Functional::operator()
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
print
void print(string text)
Definition: mergesort.cpp:30
StatEntity.h
operator<<
std::ostream & operator<<(std::ostream &, const ICounterSvc::CountObject &)
output operator for the counter object
Definition: Stat.cpp:175
StatEntity
The basic counter used for Monitoring purposes.
Definition: StatEntity.h:65
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
IInterface.h
std::ostream
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:13