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 ICounterSvc : virtual public IInterface
00079 {
00080 public:
00082 typedef StatEntity Counter ;
00098 typedef Stat CountObject ;
00100 typedef std::vector<CountObject> Counters ;
00109 class Printout
00110 {
00111 public:
00113 Printout ( ICounterSvc* svc ) ;
00115 ~Printout () ;
00117 StatusCode operator()( MsgStream& log , const Counter* cnt ) const ;
00118 private:
00119
00120 Printout () ;
00121
00122 Printout ( const Printout& ) ;
00123
00124 Printout& operator=( const Printout& ) ;
00125 private:
00127 ICounterSvc* m_svc;
00128 } ;
00137 virtual Counter* get
00138 ( const std::string& group ,
00139 const std::string& name ) const = 0;
00158 virtual Counters get ( const std::string& group ) const = 0 ;
00171 virtual StatusCode create
00172 ( const std::string& group ,
00173 const std::string& name ,
00174 longlong initial_value ,
00175 Counter*& refpCounter ) = 0;
00185 virtual CountObject create
00186 ( const std::string& group ,
00187 const std::string& name ,
00188 longlong initial_value = 0 ) = 0;
00198 virtual StatusCode remove
00199 ( const std::string& group ,
00200 const std::string& name ) = 0;
00206 virtual StatusCode remove
00207 ( const std::string& group ) = 0;
00215 virtual StatusCode print
00216 ( const std::string& group ,
00217 const std::string& name ,
00218 Printout& printer ) const = 0;
00225 virtual StatusCode print
00226 ( const std::string& group ,
00227 Printout& printer ) const = 0;
00233 virtual StatusCode print
00234 ( const Counter* pCounter ,
00235 Printout& printer ) const = 0;
00241 virtual StatusCode print
00242 ( const CountObject& pCounter ,
00243 Printout& printer ) const = 0;
00247 virtual StatusCode print
00248 ( Printout& printer ) const = 0;
00250 virtual StatusCode defaultPrintout
00251 ( MsgStream& log ,
00252 const Counter* pCounter ) const = 0;
00253
00254 enum { COUNTER_NOT_PRESENT = 2,
00255 COUNTER_EXISTS = 4,
00256 COUNTER_REMOVED = 3
00257 } ;
00258 protected:
00260 virtual ~ICounterSvc() ;
00261 public:
00263 static const InterfaceID& interfaceID() ;
00264 };
00265
00267
00268 std::ostream& operator<<( std::ostream& , const ICounterSvc::CountObject& ) ;
00269
00271
00272 #endif // GAUDIKERNEL_ICOUNTERSVC_H
00273