| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# AuditorSvc.h

Go to the documentation of this file.

    00001 // $Id: $
    00002 #ifndef AuditorSvc_AuditorSvc_H
    00003 #define AuditorSvc_AuditorSvc_H
    00004
    00005 // Include Files
    00006 #include "GaudiKernel/Service.h"
    00007 #include "GaudiKernel/IAuditorSvc.h"
    00008 #include <list>
    00009 #include <vector>
    00010
    00011 //------------------------------------------------------------------
    00012 //
    00013 // ClassName:   AuditorSvc
    00014 //
    00015 // Description: This service manages Auditors.
    00016 //              Auditors can be inserted in the system to audit the Algorithms is
    00017 //              in their functions.
    00018 //------------------------------------------------------------------
    00019 class AuditorSvc : public extends1<Service, IAuditorSvc> {
    00020
    00021 public:
    00022
    00023 // Typedefs
    00024   typedef std::list<IAuditor*>     ListAudits;
    00025   typedef std::vector<std::string> VectorName;
    00026
    00027 // Inherited Service overrides:
    00028 //
    00029   // Initialize the service.
    00030   virtual StatusCode initialize();
    00031
    00032   // Finalize the service.
    00033   virtual StatusCode finalize();
    00034
    00035 // IAuditorSvc interfaces overwrite
    00036 //
    00038
    00039   virtual void before(StandardEventType, INamedInterface*);
    00040   virtual void before(StandardEventType, const std::string&);
    00041
    00042   virtual void before(CustomEventTypeRef, INamedInterface*);
    00043   virtual void before(CustomEventTypeRef, const std::string&);
    00044
    00045   virtual void after(StandardEventType, INamedInterface*, const StatusCode&);
    00046   virtual void after(StandardEventType, const std::string&, const StatusCode&);
    00047
    00048   virtual void after(CustomEventTypeRef, INamedInterface*, const StatusCode&);
    00049   virtual void after(CustomEventTypeRef, const std::string&, const StatusCode&);
    00050
    00051   // inform Auditors that the initialize() is about to be called
    00052   virtual void beforeInitialize(INamedInterface* ini);
    00053   // inform Auditors that the initialize() has been called
    00054   virtual void afterInitialize(INamedInterface* ini);
    00055
    00056   // inform Auditors that the reinitialize() is about to be called
    00057   virtual void beforeReinitialize(INamedInterface* ini);
    00058   // inform Auditors that the reinitialize() has been called
    00059   virtual void afterReinitialize(INamedInterface* ini);
    00060
    00061   // inform Auditors that the execute() is about to be called
    00062   virtual void beforeExecute(INamedInterface* ini);
    00063   // inform Auditors that the execute() has been called
    00064   virtual void afterExecute(INamedInterface* ini, const StatusCode& );
    00065
    00066   // inform Auditors that the beginRun() is about to be called
    00067   virtual void beforeBeginRun(INamedInterface* ini);
    00068   // inform Auditors that the beginRun() has been called
    00069   virtual void afterBeginRun(INamedInterface* ini);
    00070
    00071   // inform Auditors that the endRun() is about to be called
    00072   virtual void beforeEndRun(INamedInterface* ini);
    00073   // inform Auditors that the endRun() has been called
    00074   virtual void afterEndRun(INamedInterface* ini);
    00075
    00076   // inform Auditors that the finalize() is about to be called
    00077   virtual void beforeFinalize(INamedInterface* ini);
    00078   // inform Auditors that the finalize() has been called
    00079   virtual void afterFinalize(INamedInterface* ini);
    00080
    00081   virtual bool isEnabled() const ;
    00082
    00083   virtual StatusCode sysInitialize();
    00084   virtual StatusCode sysFinalize();
    00085
    00086   // management functionality: retrieve an Auditor
    00087   virtual IAuditor* getAuditor( const std::string& name );
    00088
    00089   // Standard Constructor.
    00090   //   Input:  name   String with service name
    00091   //   Input:  svc    Pointer to service locator interface
    00092   AuditorSvc( const std::string& name, ISvcLocator* svc );
    00093
    00094   // Destructor.
    00095   virtual ~AuditorSvc();
    00096
    00097 private:
    00098   // management helper
    00099   IAuditor* newAuditor_( MsgStream&, const std::string& );
    00100   IAuditor* findAuditor_( const std::string& );
    00101   StatusCode syncAuditors_();
    00102
    00103   // List of auditor names
    00104   VectorName   m_audNameList;
    00105
    00106   // Manager list of Auditors
    00107   ListAudits   m_pAudList;
    00108
    00109   // To disable alltogether the auditors
    00110   bool m_isEnabled;
    00111 };
    00112
    00113 #endif