Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-22 04:08:22

0001 #ifndef FWCore_Framework_RunForOutput_h
0002 #define FWCore_Framework_RunForOutput_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     Framework
0007 // Class  :     RunForOutput
0008 //
0009 /**\class RunForOutput RunForOutput.h FWCore/Framework/interface/RunForOutput.h
0010 
0011 Description: This is the primary interface for outputting run products
0012 
0013 For its usage, see "FWCore/Framework/interface/PrincipalGetAdapter.h"
0014 
0015 */
0016 /*----------------------------------------------------------------------
0017 
0018 ----------------------------------------------------------------------*/
0019 
0020 #include "DataFormats/Common/interface/Wrapper.h"
0021 #include "DataFormats/Provenance/interface/RunAuxiliary.h"
0022 #include "FWCore/Framework/interface/OccurrenceForOutput.h"
0023 #include "FWCore/Framework/interface/PrincipalGetAdapter.h"
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Utilities/interface/RunIndex.h"
0026 
0027 #include <memory>
0028 #include <string>
0029 #include <typeinfo>
0030 #include <vector>
0031 
0032 namespace edmtest {
0033   class TestOutputModule;
0034 }
0035 
0036 namespace edm {
0037   class MergeableRunProductMetadata;
0038   class ModuleCallingContext;
0039 
0040   class RunForOutput : public OccurrenceForOutput {
0041   public:
0042     RunForOutput(RunTransitionInfo const&,
0043                  ModuleDescription const&,
0044                  ModuleCallingContext const*,
0045                  bool isAtEnd,
0046                  MergeableRunProductMetadata const* = nullptr);
0047     RunForOutput(RunPrincipal const&,
0048                  ModuleDescription const&,
0049                  ModuleCallingContext const*,
0050                  bool isAtEnd,
0051                  MergeableRunProductMetadata const* = nullptr);
0052     ~RunForOutput() override;
0053 
0054     RunAuxiliary const& runAuxiliary() const { return aux_; }
0055     RunID const& id() const { return aux_.id(); }
0056     RunNumber_t run() const { return aux_.run(); }
0057     Timestamp const& beginTime() const { return aux_.beginTime(); }
0058     Timestamp const& endTime() const { return aux_.endTime(); }
0059     MergeableRunProductMetadata const* mergeableRunProductMetadata() const { return mergeableRunProductMetadata_; }
0060 
0061     /**\return Reusable index which can be used to separate data for different simultaneous Runs.
0062      */
0063     RunIndex index() const;
0064 
0065   private:
0066     friend class edmtest::TestOutputModule;  // For testing
0067 
0068     RunPrincipal const& runPrincipal() const;
0069 
0070     RunAuxiliary const& aux_;
0071 
0072     MergeableRunProductMetadata const* mergeableRunProductMetadata_;
0073 
0074     static const std::string emptyString_;
0075   };
0076 }  // namespace edm
0077 #endif