Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:03

0001 #ifndef FWCore_Framework_HistoryAppender_h
0002 #define FWCore_Framework_HistoryAppender_h
0003 
0004 #include "DataFormats/Provenance/interface/ProcessHistory.h"
0005 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0006 
0007 #include <memory>
0008 
0009 namespace edm {
0010 
0011   class ProcessConfiguration;
0012 
0013   class HistoryAppender {
0014   public:
0015     HistoryAppender();
0016     HistoryAppender(HistoryAppender const&) = delete;
0017     HistoryAppender& operator=(HistoryAppender const&) = delete;
0018 
0019     // Used to append the current process to the process history
0020     // when necessary. Optimized to cache the results so it
0021     // does not need to repeat the same calculations many times.
0022     std::shared_ptr<ProcessHistory const> appendToProcessHistory(ProcessHistoryID const& inputPHID,
0023                                                                  ProcessHistory const* inputProcessHistory,
0024                                                                  ProcessConfiguration const& pc);
0025 
0026   private:
0027     // Throws if the new process name is already in the process
0028     // process history
0029     void checkProcessHistory(ProcessHistory const& ph, ProcessConfiguration const& pc) const;
0030 
0031     ProcessHistoryID m_cachedInputPHID;
0032     std::shared_ptr<ProcessHistory const> m_cachedHistory;
0033   };
0034 }  // namespace edm
0035 #endif