CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Parentage.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_Parentage_h
2 #define DataFormats_Provenance_Parentage_h
3 
4 /*----------------------------------------------------------------------
5 
6 Parentage: The products that were read in producing this product.
7 
8 ----------------------------------------------------------------------*/
11 
12 #include <iosfwd>
13 #include <vector>
14 
15 /*
16  Parentage
17 
18  definitions:
19  Product: The WrapperBase to which a provenance object is associated
20 
21  Parents: The EDProducts used as input by the creator.
22 */
23 
24 namespace edm {
25  class Parentage {
26  public:
27  Parentage();
28 
29  explicit Parentage(std::vector<BranchID> const& parents);
30 
32 
33  ParentageID id() const;
34 
35  void write(std::ostream& os) const;
36 
37  std::vector<BranchID> const& parents() const {return parents_;}
38  std::vector<BranchID>& parentsForUpdate() {return parents_;}
39  void setParents(std::vector<BranchID> const& parents) {parents_ = parents;}
40  void swap(Parentage& other) {parents_.swap(other.parents_);}
42  struct Transients {
44  void reset() {}
45  };
46 
47  private:
48  // The Branch IDs of the parents
49  std::vector<BranchID> parents_;
51  };
52 
53  // Free swap function
54  inline
55  void
57  a.swap(b);
58  }
59 
60  inline
61  std::ostream&
62  operator<<(std::ostream& os, Parentage const& p) {
63  p.write(os);
64  return os;
65  }
66 
67  // Only the 'salient attributes' are testing in equality comparison.
68  bool operator==(Parentage const& a, Parentage const& b);
69  inline bool operator!=(Parentage const& a, Parentage const& b) { return !(a == b); }
70 }
71 #endif
72 
void write(std::ostream &os) const
Definition: Parentage.cc:32
std::vector< BranchID > & parentsForUpdate()
Definition: Parentage.h:38
std::vector< BranchID > parents_
Definition: Parentage.h:49
ParentageID id() const
Definition: Parentage.cc:19
void swap(Parentage &other)
Definition: Parentage.h:40
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
std::vector< BranchID > const & parents() const
Definition: Parentage.h:37
Transients transient_
Definition: Parentage.h:50
void setParents(std::vector< BranchID > const &parents)
Definition: Parentage.h:39
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void initializeTransients()
Definition: Parentage.h:41
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.