CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Parentage.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <sstream>
5 
6 /*----------------------------------------------------------------------
7 
8 ----------------------------------------------------------------------*/
9 
10 namespace edm {
11  Parentage::Parentage() : parents_() {
12  }
13 
14  Parentage::Parentage(std::vector<BranchID> const& parents) :
15  parents_(parents) {
16  }
17 
19  Parentage::id() const {
20  std::ostringstream oss;
21  for (auto const& parent : parents_) {
22  oss << parent << ' ';
23  }
24 
25  std::string stringrep = oss.str();
26  cms::Digest md5alg(stringrep);
27  ParentageID id(md5alg.digest().toString());
28  return id;
29  }
30 
31  void
32  Parentage::write(std::ostream&) const {
33  // This is grossly inadequate, but it is not critical for the
34  // first pass.
35  }
36 
37  bool
38  operator==(Parentage const& a, Parentage const& b) {
39  return a.parents() == b.parents();
40  }
41 }
TPRegexp parents
Definition: eve_filter.cc:21
list parent
Definition: dbtoconf.py:74
void write(std::ostream &os) const
Definition: Parentage.cc:32
std::vector< BranchID > parents_
Definition: Parentage.h:49
ParentageID id() const
Definition: Parentage.cc:19
MD5Result digest() const
Definition: Digest.cc:194
std::vector< BranchID > const & parents() const
Definition: Parentage.h:37
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::string toString() const
Definition: Digest.cc:87
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121