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 {
12  parents_()
13  {}
14 
15  Parentage::Parentage(std::vector<BranchID> const& parents) :
16  parents_(parents)
17  {}
18 
20  Parentage::id() const {
21  // This implementation is ripe for optimization.
22  if(parentageID().isValid()) {
23  return parentageID();
24  }
25  std::ostringstream oss;
26  for (std::vector<BranchID>::const_iterator
27  i = parents_.begin(),
28  e = parents_.end();
29  i != e;
30  ++i)
31  {
32  oss << *i << ' ';
33  }
34 
35  std::string stringrep = oss.str();
36  cms::Digest md5alg(stringrep);
37  ParentageID tmp(md5alg.digest().toString());
38  parentageID().swap(tmp);
39  return parentageID();
40  }
41 
42  void
43  Parentage::write(std::ostream&) const {
44  // This is grossly inadequate, but it is not critical for the
45  // first pass.
46  }
47 
48  bool
49  operator==(Parentage const& a, Parentage const& b) {
50  return
51  a.parents() == b.parents();
52  }
53 }
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:24
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(Hash< I > &other)
Definition: Hash.h:202
MD5Result digest() const
Definition: Digest.cc:194
std::vector< BranchID > const & parents() const
Definition: Parentage.h:38
ParentageID & parentageID() const
Definition: Parentage.h:52
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::string toString() const
Definition: Digest.cc:87
double b
Definition: hdecay.h:120
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double a
Definition: hdecay.h:121