CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProductProvenanceRetriever.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_BranchMapper_h
2 #define DataFormats_Provenance_BranchMapper_h
3 
4 /*----------------------------------------------------------------------
5 
6 ProductProvenanceRetriever: Manages the per event/lumi/run per product provenance.
7 
8 ----------------------------------------------------------------------*/
12 
13 #include "boost/scoped_ptr.hpp"
14 #include "boost/utility.hpp"
15 
16 #include <iosfwd>
17 #include <memory>
18 #include <set>
19 
20 /*
21  ProductProvenanceRetriever
22 */
23 
24 namespace edm {
25  class ProvenanceReaderBase;
26 
27  class ProductProvenanceRetriever : private boost::noncopyable {
28  public:
29  explicit ProductProvenanceRetriever(unsigned int iTransitionIndex);
30 #ifndef __GCCXML__
31  explicit ProductProvenanceRetriever(std::unique_ptr<ProvenanceReaderBase> reader);
32 #endif
33 
35 
36  ProductProvenance const* branchIDToProvenance(BranchID const& bid) const;
37 
38  void insertIntoSet(ProductProvenance const& provenanceProduct) const;
39 
40  void mergeProvenanceRetrievers(std::shared_ptr<ProductProvenanceRetriever> other);
41 
43 
44  void reset();
45  private:
46  void readProvenance() const;
47  void setTransitionIndex(unsigned int transitionIndex) {
48  transitionIndex_=transitionIndex;
49  }
50 
51  typedef std::set<ProductProvenance> eiSet;
52 
54  std::shared_ptr<ProductProvenanceRetriever> nextRetriever_;
55  mutable std::shared_ptr<ProvenanceReaderBase> provenanceReader_;
56  unsigned int transitionIndex_;
57  mutable bool delayedRead_;
58  };
59 
61  public:
63  virtual ~ProvenanceReaderBase();
64  virtual void readProvenance(ProductProvenanceRetriever const& mapper, unsigned int transitionIndex) const = 0;
65  };
66 
67 }
68 #endif
virtual void readProvenance(ProductProvenanceRetriever const &mapper, unsigned int transitionIndex) const =0
void mergeProvenanceRetrievers(std::shared_ptr< ProductProvenanceRetriever > other)
void deepSwap(ProductProvenanceRetriever &)
std::shared_ptr< ProvenanceReaderBase > provenanceReader_
std::set< ProductProvenance > eiSet
std::shared_ptr< ProductProvenanceRetriever > nextRetriever_
ProductProvenanceRetriever(unsigned int iTransitionIndex)
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const
void setTransitionIndex(unsigned int transitionIndex)
void insertIntoSet(ProductProvenance const &provenanceProduct) const