// $Id: HistorySvc.h,v 1.8 2008/06/04 12:35:15 marcocle Exp $ #ifndef GAUDISVC_FASTHISTORYSVC_H #define GAUDISVC_FASTHISTORYSVC_H #include "GaudiKernel/IHistorySvc.h" #ifndef GAUDIKERNEL_SERVICE_H #include "GaudiKernel/Service.h" #endif #ifndef KERNEL_STATUSCODES_H #include "GaudiKernel/StatusCode.h" #endif #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/AlgTool.h" #include "GaudiKernel/IIncidentListener.h" #include #include #include #include #include #include "GaudiKernel/ClassID.h" #include "GaudiKernel/MsgStream.h" class StoreGateSvc; class IAlgContextSvc; class IIncidentSvc; class HistoryObj; class DataHistory; class AlgorithmHistory; class ServiceHistory; struct DHH; // Forward declarations template class SvcFactory; /** @class HistorySvc HistorySvc.h * * HistorySvc class definition * */ class HistorySvc: public extends2 { public: virtual StatusCode initialize(); virtual StatusCode reinitialize(); virtual StatusCode finalize(); virtual StatusCode stop(); virtual StatusCode captureState(); virtual StatusCode registerJob(); virtual StatusCode listProperties() const; virtual JobHistory* getJobHistory() const; virtual StatusCode registerSvc(const IService&); virtual StatusCode listProperties(const IService&) const; virtual ServiceHistory* getServiceHistory(const IService&) const; virtual void getServiceHistory(std::set&) const; virtual StatusCode registerAlg(const Algorithm&); virtual StatusCode listProperties(const Algorithm&) const; virtual AlgorithmHistory* getAlgHistory(const Algorithm&) const; virtual void getAlgHistory(std::set&) const; virtual StatusCode registerAlgTool(const IAlgTool&); virtual StatusCode listProperties(const IAlgTool&) const; virtual AlgToolHistory* getAlgToolHistory(const IAlgTool&) const; virtual void getAlgToolHistory(std::set&) const; virtual DataHistory* createDataHistoryObj(const CLID& id, const std::string& key, const std::string& store); virtual StatusCode registerDataHistory(const CLID& id, const std::string& key, const std::string& store); virtual DataHistory* getDataHistory(const CLID& id, const std::string& key, const std::string& store) const; virtual int getDataHistory(const CLID& id, const std::string& key, const std::string& storeName, std::list& dhlist) const; HistorySvc( const std::string& name, ISvcLocator* svc ); virtual void handle(const Incident& inc); // Destructor. virtual ~HistorySvc(); private: // typedef std::map > // DataHistMap; typedef std::multimap DataHistMap; typedef DataHistMap::iterator DHMitr; typedef DataHistMap::const_iterator DHMCitr; void clearState(); // Allow SvcFactory to instantiate the service. friend class SvcFactory; bool m_isInitialized; bool m_dump; bool m_activate; IAlgContextSvc *p_algCtxSvc; std::set m_algs; std::map m_algmap; std::set m_ialgtools; std::set m_algtools; std::map m_algtoolmap; std::set m_svcs; std::map m_svcmap; std::multimap m_datMap; // std::set m_datMap; JobHistory *m_jobHistory; std::string m_outputFile; void dumpProperties(std::ofstream&) const; void dumpProperties(const IService&, std::ofstream&) const; void dumpProperties(const Algorithm&, std::ofstream&) const; void dumpProperties(const IAlgTool&, std::ofstream&) const; void dumpState(std::ofstream&) const; void dumpState(const IService&, std::ofstream&) const; void dumpState(const Algorithm&, std::ofstream&) const; void dumpState(const IAlgTool&, std::ofstream&) const; std::string dumpProp(const Property*) const; IAlgorithm* getCurrentIAlg() const; IIncidentSvc *m_incidentSvc; SmartIF m_toolSvc; mutable MsgStream m_log; }; #endif