3 #ifndef GAUDIALG_GAUDICOMMON_H
4 #define GAUDIALG_GAUDICOMMON_H 1
17 #include "GaudiKernel/StatusCode.h"
18 #include "GaudiKernel/IMessageSvc.h"
19 #include "GaudiKernel/IToolSvc.h"
20 #include "GaudiKernel/IAlgTool.h"
21 #include "GaudiKernel/IAlgContextSvc.h"
22 #include "GaudiKernel/IDataProviderSvc.h"
23 #include "GaudiKernel/SmartDataPtr.h"
24 #include "GaudiKernel/System.h"
25 #include "GaudiKernel/GaudiException.h"
26 #include "GaudiKernel/IChronoStatSvc.h"
27 #include "GaudiKernel/StatEntity.h"
28 #include "GaudiKernel/ICounterSummarySvc.h"
29 #include "GaudiKernel/IUpdateManagerSvc.h"
30 #include "GaudiKernel/HashMap.h"
36 namespace Gaudi {
namespace Utils {
template <
class TYPE>
struct GetData ; } }
58 template <
class PBASE >
71 static const bool IgnoreRootInTES =
false;
83 static const bool UseRootInTES =
true;
88 typedef std::map<std::string,StatEntity> Statistics ;
90 typedef std::map<std::string,unsigned int> Counter ;
92 typedef std::vector<IAlgTool*> AlgTools ;
100 std::vector<std::string> m_counterList;
102 std::vector<std::string> m_statEntityList;
138 template <
class TYPE >
141 const std::string& location ,
142 const bool useRootInTES = true )
const ;
146 template <
class TYPE >
149 const std::string& location ,
150 const bool useRootInTES =
true )
const ;
177 template <
class TYPE >
179 const std::string& location ,
180 const bool useRootInTES =
true )
const ;
208 template <
class TYPE ,
class TYPE2 >
211 const std::string& location ,
212 const bool useRootInTES =
true )
const ;
240 const std::string& location ,
241 const bool useRootInTES =
true )
const ;
267 template <
class TOOL >
268 TOOL* tool (
const std::string&
type ,
269 const std::string& name ,
271 bool create =
true )
const ;
294 template <
class TOOL >
295 TOOL* tool (
const std::string&
type ,
297 bool create =
true )
const ;
320 template <
class SERVICE >
322 const bool create =
true )
const ;
350 (
const std::string&
msg ,
352 const size_t mx = 10 )
const ;
377 (
const std::string&
msg ,
379 const size_t mx = 10 )
const ;
396 (
const std::string&
msg ,
398 const size_t mx = 10 )
const ;
411 (
const std::string&
msg ,
424 const std::string& message =
"" ,
436 const char* message ,
447 (
const std::string &
msg ,
460 (
const std::string & msg ,
461 const std::exception & exc ,
472 (
const std::string& msg =
"no message" ,
507 inline const Statistics& counters()
const {
return m_counters ; }
526 inline StatEntity& counter(
const std::string& tag )
const {
return m_counters[tag] ; }
532 inline MSG::Level msgLevel()
const {
return m_msgLevel ; }
544 void resetMsgStream()
const;
546 inline bool typePrint ()
const {
return m_typePrint ; }
548 inline bool propsPrint ()
const {
return m_propsPrint ; }
550 inline bool statPrint ()
const {
return m_statPrint ; }
552 inline bool errorsPrint ()
const {
return m_errorsPrint ; }
561 void msgLevelHandler (
Property& theProp );
594 template <
class CallerClass>
595 inline void registerCondition(
const std::string &condition,
StatusCode (CallerClass::*mf)() = NULL) {
596 updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(
this),condition,mf);
628 template <
class CallerClass,
class CondType>
629 inline void registerCondition(
const std::string &condition, CondType *&condPtrDest,
631 updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(
this),condition,mf,condPtrDest);
634 template <
class CallerClass>
635 inline void registerCondition(
char *condition,
StatusCode (CallerClass::*mf)() = NULL) {
636 updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(
this),std::string(condition),mf);
653 template <
class CallerClass,
class TargetClass>
654 inline void registerCondition(TargetClass *condition,
StatusCode (CallerClass::*mf)() = NULL) {
655 updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(
this),condition,mf);
668 inline StatusCode runUpdate() {
return updMgrSvc()->update(
this); }
675 const std::string& name ,
683 {
return i_gcInitialize(); }
692 {
return i_gcFinalize(); }
733 virtual inline unsigned long release() {
return PBASE::release(); }
738 const AlgTools& tools ()
const {
return m_tools ; }
740 const Services& services ()
const {
return m_services ; }
745 void printErrorHandler (
Property& ) ;
747 void printPropsHandler (
Property& ) ;
749 void printStatHandler (
Property& ) ;
754 inline const std::string & context()
const {
return m_context; }
758 inline const std::string & rootInTES()
const {
return m_rootInTES; }
760 inline double globalTimeOffset()
const {
return m_globalTimeOffset; }
765 const std::string fullTESLocation
766 (
const std::string & location ,
767 const bool useRootInTES )
const ;
772 void addToToolList (
IAlgTool * tool )
const;
776 void initGaudiCommonConstructor(
const IInterface * parent = 0 );
785 mutable AlgTools m_tools ;
787 mutable Services m_services ;
790 mutable Counter m_errors ;
792 mutable Counter m_warnings ;
794 mutable Counter m_infos ;
796 mutable Counter m_exceptions ;
798 mutable Statistics m_counters ;
813 std::string m_context;
815 std::string m_rootInTES;
819 std::string m_rootOnTES;
821 double m_globalTimeOffset;
824 std::string m_header ;
826 std::string m_format1 ;
828 std::string m_format2 ;
830 bool m_useEffFormat ;
833 #include "GaudiAlg/GaudiCommonImp.h"
839 #endif // GAUDIALG_GAUDICOMMON_H
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Helper structure for implementation of "get"-functions for GaudiCommon
Data provider interface definition.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
Interface class to the Update Manager service.
Base class from which all concrete algorithm classes should be derived.
Property base class allowing Property* collections to be "homogeneous".
Common class providing an architecture-independent hash map.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
The basic counter used for Monitoring purposes.
A DataObject is the base class of any identifiable object on any data store.
Simple service interface to collect counters to persist in a summary file.
Helper functions to set/get the application return code.