Go to the documentation of this file.00001 #ifndef DataFormats_Provenance_TransientProductLookupMap_h
00002 #define DataFormats_Provenance_TransientProductLookupMap_h
00003
00004
00005
00006
00007
00025
00026
00027
00028
00029
00030
00031 #include <map>
00032 #include <vector>
00033
00034
00035 #include "DataFormats/Provenance/interface/TypeInBranchType.h"
00036 #include "DataFormats/Provenance/interface/BranchDescriptionIndex.h"
00037 #include "DataFormats/Provenance/interface/ProductLookupIndex.h"
00038 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
00039
00040
00041 namespace edm {
00042 class ProcessHistory;
00043
00044 struct CompareTypeInBranchTypeConstBranchDescription {
00045 bool operator()(std::pair<TypeInBranchType, ConstBranchDescription const*> const& iLHS,
00046 std::pair<TypeInBranchType, ConstBranchDescription const*> const& iRHS) const;
00047 };
00048
00049 class TransientProductLookupMap {
00050
00051 public:
00052 typedef std::vector<std::pair<TypeInBranchType, BranchDescriptionIndex> > TypeInBranchTypeLookup;
00053 typedef std::vector<ProductLookupIndex> ProductLookupIndexList;
00054
00055 typedef ProductLookupIndexList::const_iterator const_iterator;
00056
00057 typedef std::map<std::pair<TypeInBranchType, ConstBranchDescription const*>,
00058 ProductTransientIndex,
00059 CompareTypeInBranchTypeConstBranchDescription> FillFromMap;
00060
00061 TransientProductLookupMap();
00062
00063 void reset();
00064
00065
00066
00068 std::pair<const_iterator, const_iterator> equal_range(TypeInBranchType const&) const;
00069
00072 std::pair<const_iterator, const_iterator> equal_range(TypeInBranchType const&,
00073 std::string const&,
00074 std::string const&) const;
00075
00076
00077
00078
00079
00081 void reorderIfNecessary(BranchType, ProcessHistory const&, std::string const& iNewProcessName);
00082
00083 void fillFrom(FillFromMap const&);
00084
00085 const_iterator begin() const {return productLookupIndexList_.begin();}
00086
00087 const_iterator end() const {return productLookupIndexList_.end();}
00088
00089 int fillCount() const {return fillCount_;}
00090
00091 private:
00092
00093 TypeInBranchTypeLookup branchLookup_;
00094 ProductLookupIndexList productLookupIndexList_;
00095 std::vector<ProcessHistoryID> historyIDsForBranchType_;
00096 std::vector<std::vector<std::string> > processNameOrderingForBranchType_;
00097 int fillCount_;
00098 };
00099
00100 }
00101
00102 #endif