Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef GAUDIKERNEL_ICOUNTERSVC_H
00006 #define GAUDIKERNEL_ICOUNTERSVC_H
00007
00008
00009
00010
00011
00012 #include <string>
00013 #include <vector>
00014
00015
00016
00017 #include "GaudiKernel/IInterface.h"
00018 #include "GaudiKernel/StatEntity.h"
00019 #include "GaudiKernel/Stat.h"
00020
00021
00022
00023 class MsgStream ;
00024 class StatEntity ;
00025 class ICounterSvc ;
00026
00078 class GAUDI_API ICounterSvc: virtual public IInterface
00079 {
00080 public:
00082 DeclareInterfaceID(ICounterSvc,4,0);
00084 typedef StatEntity Counter ;
00100 typedef Stat CountObject ;
00102 typedef std::vector<CountObject> Counters ;
00111 class Printout
00112 {
00113 public:
00115 Printout ( ICounterSvc* svc ) ;
00117 ~Printout () ;
00119 StatusCode operator()( MsgStream& log , const Counter* cnt ) const ;
00120 private:
00121
00122 Printout () ;
00123
00124 Printout ( const Printout& ) ;
00125
00126 Printout& operator=( const Printout& ) ;
00127 private:
00129 ICounterSvc* m_svc;
00130 } ;
00139 virtual Counter* get
00140 ( const std::string& group ,
00141 const std::string& name ) const = 0;
00160 virtual Counters get ( const std::string& group ) const = 0 ;
00173 virtual StatusCode create
00174 ( const std::string& group ,
00175 const std::string& name ,
00176 longlong initial_value ,
00177 Counter*& refpCounter ) = 0;
00187 virtual CountObject create
00188 ( const std::string& group ,
00189 const std::string& name ,
00190 longlong initial_value = 0 ) = 0;
00200 virtual StatusCode remove
00201 ( const std::string& group ,
00202 const std::string& name ) = 0;
00208 virtual StatusCode remove
00209 ( const std::string& group ) = 0;
00217 virtual StatusCode print
00218 ( const std::string& group ,
00219 const std::string& name ,
00220 Printout& printer ) const = 0;
00227 virtual StatusCode print
00228 ( const std::string& group ,
00229 Printout& printer ) const = 0;
00235 virtual StatusCode print
00236 ( const Counter* pCounter ,
00237 Printout& printer ) const = 0;
00243 virtual StatusCode print
00244 ( const CountObject& pCounter ,
00245 Printout& printer ) const = 0;
00249 virtual StatusCode print
00250 ( Printout& printer ) const = 0;
00252 virtual StatusCode defaultPrintout
00253 ( MsgStream& log ,
00254 const Counter* pCounter ) const = 0;
00255
00256 enum { COUNTER_NOT_PRESENT = 2,
00257 COUNTER_EXISTS = 4,
00258 COUNTER_REMOVED = 3
00259 } ;
00260 protected:
00262 virtual ~ICounterSvc() ;
00263 };
00264
00266
00267 std::ostream& operator<<( std::ostream& , const ICounterSvc::CountObject& ) ;
00268
00270
00271 #endif // GAUDIKERNEL_ICOUNTERSVC_H
00272