CMS 3D CMS Logo

ProductProvenanceRetriever.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ProductProvenanceRetriever_h
2 #define DataFormats_Provenance_ProductProvenanceRetriever_h
3 
4 /*----------------------------------------------------------------------
5 
6 ProductProvenanceRetriever: Manages the per event/lumi/run per product provenance.
7 
8 ----------------------------------------------------------------------*/
13 
14 #include <memory>
15 #include <set>
16 #include <atomic>
17 
18 /*
19  ProductProvenanceRetriever
20 */
21 
22 namespace edm {
23  class ModuleCallingContext;
24  class ProductRegistry;
25 
27  public:
29  virtual ~ProvenanceReaderBase();
30  virtual std::set<ProductProvenance> readProvenance(unsigned int transitionIndex) const = 0;
32  ModuleCallingContext const* moduleCallingContext,
33  unsigned int transitionIndex,
34  std::atomic<const std::set<ProductProvenance>*>& writeTo) const noexcept = 0;
35  };
36 
38  public:
39  explicit ProductProvenanceRetriever(unsigned int iTransitionIndex);
40  ProductProvenanceRetriever(unsigned int iTransitionIndex, edm::ProductRegistry const&);
41  explicit ProductProvenanceRetriever(std::unique_ptr<ProvenanceReaderBase> reader);
42 
44 
45  void mergeProvenanceRetrievers(std::shared_ptr<ProductProvenanceRetriever> other);
46 
48 
50 
51  void reset();
52 
53  void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const* moduleCallingContext) const noexcept;
54 
55  private:
56  std::unique_ptr<const std::set<ProductProvenance>> readProvenance() const final;
57  const ProductProvenanceLookup* nextRetriever() const final { return nextRetriever_.get(); }
58  void setTransitionIndex(unsigned int transitionIndex) { transitionIndex_ = transitionIndex; }
59 
61  std::shared_ptr<const ProvenanceReaderBase> provenanceReader_;
62  unsigned int transitionIndex_;
63  };
64 
65 } // namespace edm
66 #endif
void deepCopy(ProductProvenanceRetriever const &)
reader
Definition: DQM.py:105
void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const *moduleCallingContext) const noexcept
ProductProvenanceRetriever & operator=(ProductProvenanceRetriever const &)=delete
std::unique_ptr< const std::set< ProductProvenance > > readProvenance() const final
void mergeParentProcessRetriever(ProductProvenanceRetriever const &provRetriever)
void mergeProvenanceRetrievers(std::shared_ptr< ProductProvenanceRetriever > other)
const ProductProvenanceLookup * nextRetriever() const final
std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
virtual std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const =0
ProductProvenanceRetriever(unsigned int iTransitionIndex)
HLT enums.
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_
virtual void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const *moduleCallingContext, unsigned int transitionIndex, std::atomic< const std::set< ProductProvenance > *> &writeTo) const noexcept=0
void setTransitionIndex(unsigned int transitionIndex)