CMS 3D CMS Logo

ProductProvenance.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ProductProvenance_h
2 #define DataFormats_Provenance_ProductProvenance_h
3 
4 /*----------------------------------------------------------------------
5 
6 ProductProvenance: The event dependent portion of the description of a product
7 and how it came into existence.
8 
9 ----------------------------------------------------------------------*/
13 
14 #include <memory>
15 
16 #include <iosfwd>
17 #include <vector>
18 
19 /*
20  ProductProvenance
21 */
22 
23 namespace edm {
25  public:
27  explicit ProductProvenance(BranchID bid);
29 
30  ProductProvenance(BranchID bid, std::vector<BranchID> const& parents);
31 
32  ProductProvenance(BranchID bid, std::vector<BranchID>&& parents);
33 
35 
36  void write(std::ostream& os) const;
37 
38  BranchID const& branchID() const { return branchID_; }
39  ParentageID const& parentageID() const { return parentageID_; }
40  Parentage const& parentage() const;
41 
42  void set(ParentageID id) { parentageID_ = std::move(id); }
44 
45  private:
48  };
49 
50  inline bool operator<(ProductProvenance const& a, ProductProvenance const& b) { return a.branchID() < b.branchID(); }
51 
52  inline std::ostream& operator<<(std::ostream& os, ProductProvenance const& p) {
53  p.write(os);
54  return os;
55  }
56 
57  // Only the 'salient attributes' are testing in equality comparison.
58  bool operator==(ProductProvenance const& a, ProductProvenance const& b);
59  inline bool operator!=(ProductProvenance const& a, ProductProvenance const& b) { return !(a == b); }
60  typedef std::vector<ProductProvenance> ProductProvenanceVector;
61 } // namespace edm
62 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:89
constexpr bool operator==(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
ProductProvenance makeProductProvenance() const
TPRegexp parents
Definition: eve_filter.cc:21
ParentageID const & parentageID() const
ParentageID moveParentageID()
constexpr bool operator!=(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
std::vector< ProductProvenance > ProductProvenanceVector
BranchID const & branchID() const
void write(std::ostream &os) const
double b
Definition: hdecay.h:118
HLT enums.
double a
Definition: hdecay.h:119
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
def move(src, dest)
Definition: eostools.py:511
Parentage const & parentage() const