![]() |
|
|
Generated: 18 Jul 2008 |
00001 // $Id: ICounterSvc.h,v 1.4 2007/08/06 08:39:40 marcocle Exp $ 00002 // ============================================================================ 00003 // CVS tag $Name: v25r2 $, version $Revision: 1.4 $ 00004 // ============================================================================ 00005 #ifndef GAUDIKERNEL_ICOUNTERSVC_H 00006 #define GAUDIKERNEL_ICOUNTERSVC_H 00007 // ============================================================================ 00008 // Include files 00009 // ============================================================================ 00010 // STD & STL 00011 // ============================================================================ 00012 #include <string> 00013 #include <vector> 00014 // ============================================================================ 00015 // GaudiKernel 00016 // ============================================================================ 00017 #include "GaudiKernel/IInterface.h" 00018 #include "GaudiKernel/StatEntity.h" 00019 #include "GaudiKernel/Stat.h" 00020 // ============================================================================ 00021 // Forward declarations 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 // no defauld constructor 00120 Printout () ; 00121 // no copy 00122 Printout ( const Printout& ) ; //< no coy constructor 00123 // no assignement 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 // Return codes: 00254 enum { COUNTER_NOT_PRESENT = 2, // Error 00255 COUNTER_EXISTS = 4, // Error ? 00256 COUNTER_REMOVED = 3 // Type of success. Low bit set 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 // ============================================================================