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 EDProduct 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  // Only the 'salient attributes' are encoded into the ID.
34  ParentageID id() const;
35 
36  void write(std::ostream& os) const;
37 
38  std::vector<BranchID> const& parents() const {return parents_;}
39  std::vector<BranchID> & parents() {return parents_;}
40  void swap(Parentage& other) {parents_.swap(other.parents_); parentageID().swap(other.parentageID());}
41 
43 
44  struct Transients {
46  void reset() {parentageID_.reset();}
48  };
49 
50 
51  private:
53  // The Branch IDs of the parents
54  std::vector<BranchID> parents_;
56 
57  };
58 
59  // Free swap function
60  inline
61  void
63  a.swap(b);
64  }
65 
66  inline
67  std::ostream&
68  operator<<(std::ostream& os, Parentage const& p) {
69  p.write(os);
70  return os;
71  }
72 
73  // Only the 'salient attributes' are testing in equality comparison.
74  bool operator==(Parentage const& a, Parentage const& b);
75  inline bool operator!=(Parentage const& a, Parentage const& b) { return !(a == b); }
76 }
77 #endif
78 
void write(std::ostream &os) const
Definition: Parentage.cc:43
std::vector< BranchID > parents_
Definition: Parentage.h:54
ParentageID id() const
Definition: Parentage.cc:20
void swap(Parentage &other)
Definition: Parentage.h:40
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void swap(Hash< I > &other)
Definition: Hash.h:202
ParentageID parentageID_
Definition: Parentage.h:47
std::vector< BranchID > & parents()
Definition: Parentage.h:39
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
std::vector< BranchID > const & parents() const
Definition: Parentage.h:38
Transients transient_
Definition: Parentage.h:55
ParentageID & parentageID() const
Definition: Parentage.h:52
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void initializeTransients() const
Definition: Parentage.h:42
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
void reset()
Definition: Hash.h:139