00001 #ifndef FWCore_Framework_RunPrincipal_h 00002 #define FWCore_Framework_RunPrincipal_h 00003 00004 /*---------------------------------------------------------------------- 00005 00006 RunPrincipal: This is the class responsible for management of 00007 per run EDProducts. It is not seen by reconstruction code; 00008 such code sees the Run class, which is a proxy for RunPrincipal. 00009 00010 The major internal component of the RunPrincipal 00011 is the DataBlock. 00012 00013 ----------------------------------------------------------------------*/ 00014 00015 #include <string> 00016 #include <vector> 00017 00018 #include "boost/shared_ptr.hpp" 00019 00020 #include "DataFormats/Provenance/interface/RunAuxiliary.h" 00021 #include "FWCore/Framework/interface/Principal.h" 00022 00023 namespace edm { 00024 00025 class HistoryAppender; 00026 class UnscheduledHandler; 00027 00028 class RunPrincipal : public Principal { 00029 public: 00030 typedef RunAuxiliary Auxiliary; 00031 typedef Principal Base; 00032 00033 RunPrincipal( 00034 boost::shared_ptr<RunAuxiliary> aux, 00035 boost::shared_ptr<ProductRegistry const> reg, 00036 ProcessConfiguration const& pc, 00037 HistoryAppender* historyAppender); 00038 ~RunPrincipal() {} 00039 00040 void fillRunPrincipal(DelayedReader* reader = 0); 00041 00042 RunAuxiliary const& aux() const { 00043 return *aux_; 00044 } 00045 00046 RunNumber_t run() const { 00047 return aux().run(); 00048 } 00049 00050 RunID const& id() const { 00051 return aux().id(); 00052 } 00053 00054 Timestamp const& beginTime() const { 00055 return aux().beginTime(); 00056 } 00057 00058 Timestamp const& endTime() const { 00059 return aux().endTime(); 00060 } 00061 00062 void setEndTime(Timestamp const& time) { 00063 aux_->setEndTime(time); 00064 } 00065 00066 void mergeAuxiliary(RunAuxiliary const& aux) { 00067 return aux_->mergeAuxiliary(aux); 00068 } 00069 00070 void setUnscheduledHandler(boost::shared_ptr<UnscheduledHandler>) {} 00071 00072 void put( 00073 ConstBranchDescription const& bd, 00074 WrapperOwningHolder const& edp); 00075 00076 void readImmediate() const; 00077 00078 void setComplete() { 00079 complete_ = true; 00080 } 00081 00082 private: 00083 00084 virtual bool isComplete_() const override {return complete_;} 00085 00086 virtual bool unscheduledFill(std::string const&) const override {return false;} 00087 00088 void resolveProductImmediate(ProductHolderBase const& phb) const; 00089 00090 // A vector of product holders. 00091 boost::shared_ptr<RunAuxiliary> aux_; 00092 00093 bool complete_; 00094 }; 00095 } 00096 #endif 00097