Go to the documentation of this file.00001 #ifndef FWCore_Framework_PrincipalCache_h
00002 #define FWCore_Framework_PrincipalCache_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
00027 #include "DataFormats/Provenance/interface/RunID.h"
00028 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
00029
00030 #include "boost/shared_ptr.hpp"
00031
00032 namespace edm {
00033
00034 class RunPrincipal;
00035 class LuminosityBlockPrincipal;
00036 class EventPrincipal;
00037 class RunAuxiliary;
00038 class LuminosityBlockAuxiliary;
00039 class ProductRegistry;
00040
00041 class PrincipalCache {
00042 public:
00043
00044 PrincipalCache();
00045 ~PrincipalCache();
00046
00047 RunPrincipal& runPrincipal(ProcessHistoryID const& phid, RunNumber_t run) const;
00048 boost::shared_ptr<RunPrincipal> const& runPrincipalPtr(ProcessHistoryID const& phid, RunNumber_t run) const;
00049 RunPrincipal& runPrincipal() const;
00050 boost::shared_ptr<RunPrincipal> const& runPrincipalPtr() const;
00051 bool hasRunPrincipal() const {return runPrincipal_;}
00052
00053 LuminosityBlockPrincipal& lumiPrincipal(ProcessHistoryID const& phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const;
00054 boost::shared_ptr<LuminosityBlockPrincipal> const& lumiPrincipalPtr(ProcessHistoryID const& phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const;
00055 LuminosityBlockPrincipal& lumiPrincipal() const;
00056 boost::shared_ptr<LuminosityBlockPrincipal> const& lumiPrincipalPtr() const;
00057 bool hasLumiPrincipal() const {return lumiPrincipal_;}
00058
00059 EventPrincipal& eventPrincipal() const { return *eventPrincipal_; }
00060
00061 void merge(boost::shared_ptr<RunAuxiliary> aux, boost::shared_ptr<ProductRegistry const> reg);
00062 void merge(boost::shared_ptr<LuminosityBlockAuxiliary> aux, boost::shared_ptr<ProductRegistry const> reg);
00063
00064 void insert(boost::shared_ptr<RunPrincipal> rp);
00065 void insert(boost::shared_ptr<LuminosityBlockPrincipal> lbp);
00066 void insert(boost::shared_ptr<EventPrincipal> ep) { eventPrincipal_ = ep; }
00067
00068 void deleteRun(ProcessHistoryID const& phid, RunNumber_t run);
00069 void deleteLumi(ProcessHistoryID const& phid, RunNumber_t run, LuminosityBlockNumber_t lumi);
00070
00071 void adjustEventToNewProductRegistry(boost::shared_ptr<ProductRegistry const> reg);
00072
00073 void adjustIndexesAfterProductRegistryAddition();
00074
00075 private:
00076
00077 void throwRunMissing() const;
00078 void throwLumiMissing() const;
00079
00080
00081
00082 boost::shared_ptr<RunPrincipal> runPrincipal_;
00083 boost::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal_;
00084 boost::shared_ptr<EventPrincipal> eventPrincipal_;
00085
00086
00087
00088
00089
00090
00091
00092
00093 ProcessHistoryID inputProcessHistoryID_;
00094 ProcessHistoryID reducedInputProcessHistoryID_;
00095 RunNumber_t run_;
00096 LuminosityBlockNumber_t lumi_;
00097 };
00098 }
00099
00100 #endif