CMS 3D CMS Logo

ProductProvenance.cc
Go to the documentation of this file.
3 
4 #include <cassert>
5 #include <ostream>
6 
7 /*----------------------------------------------------------------------
8 
9 ----------------------------------------------------------------------*/
10 
11 namespace {
12  edm::Parentage const s_emptyParentage;
13 }
14 namespace edm {
15  ProductProvenance::ProductProvenance() : branchID_(), parentageID_() {}
16 
17  ProductProvenance::ProductProvenance(BranchID bid) : branchID_(bid), parentageID_() {}
18 
20  : branchID_(bid), parentageID_(std::move(edid)) {}
21 
22  ProductProvenance::ProductProvenance(BranchID bid, std::vector<BranchID> const& parents)
23  : branchID_(bid), parentageID_() {
24  Parentage p;
25  p.setParents(parents);
26  parentageID_ = p.id();
28  }
29 
30  ProductProvenance::ProductProvenance(BranchID bid, std::vector<BranchID>&& parents) : branchID_(bid), parentageID_() {
31  Parentage p;
32  p.setParents(std::move(parents));
33  parentageID_ = p.id();
35  }
36 
38 
41  if (p) {
42  return *p;
43  }
44  return s_emptyParentage;
45  }
46 
47  void ProductProvenance::write(std::ostream& os) const {
48  os << "branch ID = " << branchID() << '\n';
49  os << "entry description ID = " << parentageID() << '\n';
50  }
51 
53  return a.branchID() == b.branchID() && a.parentageID() == b.parentageID();
54  }
55 } // namespace edm
constexpr bool operator==(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
ProductProvenance makeProductProvenance() const
TPRegexp parents
Definition: eve_filter.cc:21
ParentageID const & parentageID() const
bool getMapped(key_type const &k, value_type &result) const
BranchID const & branchID() const
void write(std::ostream &os) const
double b
Definition: hdecay.h:118
HLT enums.
double a
Definition: hdecay.h:119
static ParentageRegistry * instance()
bool insertMapped(value_type const &v)
def move(src, dest)
Definition: eostools.py:511
Parentage const & parentage() const