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>
20 
21 /*
22  ProductProvenanceRetriever
23 */
24 
25 namespace edm {
26  class ProvenanceReaderBase;
27 
28  class ProductProvenanceRetriever : private boost::noncopyable {
29  public:
30  explicit ProductProvenanceRetriever(unsigned int iTransitionIndex);
31 #ifndef __GCCXML__
32  explicit ProductProvenanceRetriever(std::unique_ptr<ProvenanceReaderBase> reader);
33 #endif
34 
36 
37  ProductProvenance const* branchIDToProvenance(BranchID const& bid) const;
38 
39  void insertIntoSet(ProductProvenance const& provenanceProduct) const;
40 
41  void mergeProvenanceRetrievers(std::shared_ptr<ProductProvenanceRetriever> other);
42 
44 
45  void reset();
46  private:
47  void readProvenance() const;
48  void setTransitionIndex(unsigned int transitionIndex) {
49  transitionIndex_=transitionIndex;
50  }
51 
52  typedef std::set<ProductProvenance> eiSet;
53 
55  std::shared_ptr<ProductProvenanceRetriever> nextRetriever_;
56  mutable std::shared_ptr<ProvenanceReaderBase> provenanceReader_;
57  unsigned int transitionIndex_;
58  mutable bool delayedRead_;
59  };
60 
62  public:
64  virtual ~ProvenanceReaderBase();
65  virtual void readProvenance(ProductProvenanceRetriever const& mapper, unsigned int transitionIndex) const = 0;
66  };
67 
68 }
69 #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