CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProductProvenance.cc
Go to the documentation of this file.
3 
4 #include <cassert>
5 #include <ostream>
6 
7 /*----------------------------------------------------------------------
8 
9 ----------------------------------------------------------------------*/
10 
11 namespace edm {
13  parentagePtr_(),
14  noParentage_(false)
15  {}
16 
17  void
19  parentagePtr_.reset();
20  noParentage_ = false;
21  }
22 
24  branchID_(),
25  parentageID_(),
26  transient_()
27  {}
28 
30  branchID_(bid),
31  parentageID_(),
32  transient_()
33  {}
34 
36  ParentageID const& edid) :
37  branchID_(bid),
38  parentageID_(edid),
39  transient_()
40  {}
41 
43  std::shared_ptr<Parentage> pPtr) :
44  branchID_(bid),
45  parentageID_(pPtr->id()),
46  transient_() {
47  parentagePtr() = pPtr;
49  }
50 
52  std::vector<BranchID> const& parents) :
53  branchID_(bid),
54  parentageID_(),
55  transient_() {
56  parentagePtr() = std::make_shared<Parentage>();
57  parentagePtr()->setParents(parents);
58  parentageID_ = parentagePtr()->id();
60  }
61 
64  return *this;
65  }
66 
67  Parentage const &
69  if (!parentagePtr()) {
70  parentagePtr().reset(new Parentage);
72  }
73  return *parentagePtr();
74  }
75 
76  void
77  ProductProvenance::write(std::ostream& os) const {
78  os << "branch ID = " << branchID() << '\n';
79  if (!noParentage()) {
80  os << "entry description ID = " << parentageID() << '\n';
81  }
82  }
83 
84  bool
86  if (a.noParentage() != b.noParentage()) return false;
87  if (a.noParentage()) {
88  return
89  a.branchID() == b.branchID();
90  }
91  return
92  a.branchID() == b.branchID() && a.parentageID() == b.parentageID();
93  }
94 }
BranchID const & branchID() const
TPRegexp parents
Definition: eve_filter.cc:21
void write(std::ostream &os) const
bool getMapped(key_type const &k, value_type &result) const
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
ProductProvenance makeProductProvenance() const
bool & noParentage() const
double b
Definition: hdecay.h:120
ParentageID const & parentageID() const
double a
Definition: hdecay.h:121
std::shared_ptr< Parentage > & parentagePtr() const
Parentage const & parentage() const
volatile std::atomic< bool > shutdown_flag false
static ParentageRegistry * instance()
bool insertMapped(value_type const &v)