CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Provenance.cc
Go to the documentation of this file.
7 
8 #include <algorithm>
9 #include <cassert>
10 
11 /*----------------------------------------------------------------------
12 
13 ----------------------------------------------------------------------*/
14 
15 namespace edm {
16 
17  Provenance::Provenance() : Provenance{std::shared_ptr<BranchDescription const>(), ProductID()} {
18  }
19 
20  Provenance::Provenance(std::shared_ptr<BranchDescription const> const& p, ProductID const& pid) :
21  branchDescription_(p),
22  productID_(pid),
23  processHistory_(),
24  productProvenanceValid_(false),
25  productProvenancePtr_(new ProductProvenance),
26  store_() {
27  }
28 
31  if(!store_) {
32  return nullptr;
33  }
35  ProductProvenance const* prov = store_->branchIDToProvenance(branchDescription_->branchID());
36  if (prov) {
37  *productProvenancePtr_ = *prov;
39  }
40  }
41  return productProvenancePtr_.get();
42  }
43 
44  bool
47  }
48 
53  return pc.releaseVersion();
54  }
55 
56  void
57  Provenance::write(std::ostream& os) const {
58  // This is grossly inadequate, but it is not critical for the
59  // first pass.
60  product().write(os);
62  if (pp != nullptr) {
63  pp->write(os);
64  }
65  }
66 
67  bool operator==(Provenance const& a, Provenance const& b) {
68  return a.product() == b.product();
69  }
70 
71  void
75  }
76 
77  void
79  *productProvenancePtr_ = prov;
81  }
82 
83  void
86  productID_.swap(iOther.productID_);
90  store_.swap(iOther.store_);
91  }
92 }
std::shared_ptr< ProductProvenanceRetriever > store_
Definition: Provenance.h:100
tuple pp
Definition: createTree.py:15
ReleaseVersion releaseVersion() const
Definition: Provenance.cc:50
assert(m_qm.get())
ProductProvenance * productProvenance() const
Definition: Provenance.h:49
bool getProcessConfiguration(ProcessConfiguration &pc) const
Definition: Provenance.cc:45
ProductID productID_
Definition: Provenance.h:96
std::string const & processName() const
Definition: Provenance.h:61
std::shared_ptr< BranchDescription const > branchDescription_
Definition: Provenance.h:95
void swap(ProductID &other)
Definition: ProductID.cc:17
void resetProductProvenance() const
Definition: Provenance.cc:72
void write(std::ostream &os) const
Definition: Provenance.cc:57
void write(std::ostream &os) const
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
void write(std::ostream &os) const
ProductProvenance * resolve() const
Definition: Provenance.cc:30
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
BranchDescription const & product() const
Definition: Provenance.h:42
bool productProvenanceValid_
Definition: Provenance.h:98
ReleaseVersion const & releaseVersion() const
ProcessHistory const * processHistory_
Definition: Provenance.h:97
tuple pid
Definition: sysUtil.py:22
double b
Definition: hdecay.h:120
std::string ReleaseVersion
Definition: ReleaseVersion.h:7
std::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:99
double a
Definition: hdecay.h:121
void setProductProvenance(ProductProvenance const &prov) const
Definition: Provenance.cc:78
volatile std::atomic< bool > shutdown_flag false
void swap(Provenance &)
Definition: Provenance.cc:84