| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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/StatEntity.h"
16 #include "GaudiKernel/SmartIF.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
133 ( const std::string& group ,
134 const std::string& name ) const = 0;
153 virtual Counters get ( const std::string& group ) const = 0 ;
166 virtual StatusCode create
167 ( const std::string& group ,
168 const std::string& name ,
169 longlong initial_value ,
170 Counter*& refpCounter ) = 0;
180 virtual CountObject create
181 ( const std::string& group ,
182 const std::string& name ,
183 longlong initial_value = 0 ) = 0;
193 virtual StatusCode remove
194 ( const std::string& group ,
195 const std::string& name ) = 0;
201 virtual StatusCode remove
202 ( const std::string& group ) = 0;
210 virtual StatusCode print
211 ( const std::string& group ,
212 const std::string& name ,
213 Printout& printer ) const = 0;
220 virtual StatusCode print
221 ( const std::string& group ,
222 Printout& printer ) const = 0;
228 virtual StatusCode print
229 ( const Counter* pCounter ,
230 Printout& printer ) const = 0;
236 virtual StatusCode print
237 ( const CountObject& pCounter ,
238 Printout& printer ) const = 0;
242 virtual StatusCode print
243 ( Printout& printer ) const = 0;
245 virtual StatusCode defaultPrintout
246 ( MsgStream& log ,
247 const Counter* pCounter ) const = 0;
248 // Return codes:
249 enum { COUNTER_NOT_PRESENT = 2, // Error
250 COUNTER_EXISTS = 4, // Error ?
251 COUNTER_REMOVED = 3 // Type of success. Low bit set
252 } ;
253 };
254 // ============================================================================
256 // ============================================================================
257 std::ostream& operator<<( std::ostream& , const ICounterSvc::CountObject& ) ;
258 // ============================================================================
260 // ============================================================================
261 #endif // GAUDIKERNEL_ICOUNTERSVC_H
262 // ============================================================================
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< ICounterSvc >
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
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
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:14
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
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
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:33
StatEntity.h
operator<<
std::ostream & operator<<(std::ostream &, const ICounterSvc::CountObject &)
output operator for the counter object
Definition: Stat.cpp:181
StatEntity
The basic counter used for Monitoring purposes.
Definition: StatEntity.h:65
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
IInterface.h
std::ostream
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:13