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 ----------------------------------------------------------------------*/
12 
13 #include "boost/scoped_ptr.hpp"
14 #include "boost/shared_ptr.hpp"
15 #include "boost/utility.hpp"
16 
17 #include <iosfwd>
18 #include <memory>
19 #include <set>
20 
21 /*
22  BranchMapper
23 */
24 
25 namespace edm {
26  class ProvenanceReaderBase;
27 
28  class BranchMapper : private boost::noncopyable {
29  public:
30  BranchMapper();
31 #ifndef __GCCXML__
32  explicit BranchMapper(std::unique_ptr<ProvenanceReaderBase> reader);
33 #endif
34 
35  ~BranchMapper();
36 
37  ProductProvenance const* branchIDToProvenance(BranchID const& bid) const;
38 
39  void insertIntoSet(ProductProvenance const& provenanceProduct) const;
40 
41  void mergeMappers(boost::shared_ptr<BranchMapper> other);
42 
43  void reset();
44  private:
45  void readProvenance() const;
46 
47  typedef std::set<ProductProvenance> eiSet;
48 
50  boost::shared_ptr<BranchMapper> nextMapper_;
51  mutable bool delayedRead_;
52  mutable boost::scoped_ptr<ProvenanceReaderBase> provenanceReader_;
53  };
54 
56  public:
58  virtual ~ProvenanceReaderBase();
59  virtual void readProvenance(BranchMapper const& mapper) const = 0;
60  };
61 
62 }
63 #endif
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const
Definition: BranchMapper.cc:58
virtual void readProvenance(BranchMapper const &mapper) const =0
boost::scoped_ptr< ProvenanceReaderBase > provenanceReader_
Definition: BranchMapper.h:52
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:50
void mergeMappers(boost::shared_ptr< BranchMapper > other)
Definition: BranchMapper.cc:53
void insertIntoSet(ProductProvenance const &provenanceProduct) const
Definition: BranchMapper.cc:44
void readProvenance() const
Definition: BranchMapper.cc:30
std::set< ProductProvenance > eiSet
Definition: BranchMapper.h:47