CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BranchMapper.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_BranchMapper_h
2 #define DataFormats_Provenance_BranchMapper_h
3 
4 /*----------------------------------------------------------------------
5 
6 BranchMapper: Manages the per event/lumi/run per product provenance.
7 
8 ----------------------------------------------------------------------*/
9 #include <iosfwd>
10 #include <set>
11 #include <map>
12 
13 #include "boost/shared_ptr.hpp"
14 
18 
19 /*
20  BranchMapper
21 
22 */
23 
24 namespace edm {
25  class ProductID;
26  class BranchMapper {
27  public:
28  BranchMapper();
29 
30  explicit BranchMapper(bool delayedRead);
31 
32  virtual ~BranchMapper();
33 
34  void write(std::ostream& os) const;
35 
36  boost::shared_ptr<ProductProvenance> branchIDToProvenance(BranchID const& bid) const;
37 
38  void insert(ProductProvenance const& provenanceProduct);
39 
40  void mergeMappers(boost::shared_ptr<BranchMapper> other) {nextMapper_ = other;}
41 
43 
44  BranchID oldProductIDToBranchID(ProductID const& oldProductID) const {
45  return oldProductIDToBranchID_(oldProductID);
46  }
47 
49 
51 
52  private:
53  typedef std::set<ProductProvenance> eiSet;
54 
55  void readProvenance() const;
56  virtual void readProvenance_() const {}
57 
58  virtual BranchID oldProductIDToBranchID_(ProductID const& oldProductID) const;
59 
61 
62  boost::shared_ptr<BranchMapper> nextMapper_;
63 
64  mutable bool delayedRead_;
65 
67  };
68 
69  inline
70  std::ostream&
71  operator<<(std::ostream& os, BranchMapper const& p) {
72  p.write(os);
73  return os;
74  }
75 }
76 #endif
void write(std::ostream &os) const
virtual BranchID oldProductIDToBranchID_(ProductID const &oldProductID) const
Definition: BranchMapper.cc:59
virtual void readProvenance_() const
Definition: BranchMapper.h:56
ProcessHistoryID processHistoryID_
Definition: BranchMapper.h:66
void insert(ProductProvenance const &provenanceProduct)
Definition: BranchMapper.cc:35
ProcessHistoryID const & processHistoryID() const
Definition: BranchMapper.h:48
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:62
virtual ~BranchMapper()
Definition: BranchMapper.cc:24
void mergeMappers(boost::shared_ptr< BranchMapper > other)
Definition: BranchMapper.h:40
boost::shared_ptr< ProductProvenance > branchIDToProvenance(BranchID const &bid) const
Definition: BranchMapper.cc:44
BranchID oldProductIDToBranchID(ProductID const &oldProductID) const
Definition: BranchMapper.h:44
void readProvenance() const
Definition: BranchMapper.cc:27
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
ProcessHistoryID & processHistoryID()
Definition: BranchMapper.h:50
std::set< ProductProvenance > eiSet
Definition: BranchMapper.h:53
void setDelayedRead(bool value)
Definition: BranchMapper.h:42