Parentage.cc
Go to the documentation of this file.
2 #include "cetlib/MD5Digest.h"
3 // vim: set sw=2 expandtab :
4 
5 #include <ostream>
6 #include <string>
7 #include <vector>
8 
9 using namespace std;
10 
11 namespace art {
12 
13  Parentage::~Parentage() = default;
14  Parentage::Parentage() = default;
15 
16  Parentage::Parentage(Parentage const&) = default;
17  Parentage::Parentage(Parentage&&) = default;
18 
19  Parentage& Parentage::operator=(Parentage const&) = default;
20  Parentage& Parentage::operator=(Parentage&&) = default;
21 
22  Parentage::Parentage(vector<ProductID> parents) : parents_{move(parents)} {}
23 
25  Parentage::id() const
26  {
27  ostringstream oss;
28  for (auto const pid : parents_) {
29  oss << pid << ' ';
30  }
31  string const stringrep{oss.str()};
32  return ParentageID{cet::MD5Digest{stringrep}.digest().toString()};
33  }
34 
35  vector<ProductID> const&
37  {
38  return parents_;
39  }
40 
41  ostream&
42  operator<<(ostream& os, Parentage const&)
43  {
44  // Unimplemented
45  return os;
46  }
47 
48  bool
49  operator==(Parentage const& a, Parentage const& b)
50  {
51  return a.parents() == b.parents();
52  }
53 
54  bool
55  operator!=(Parentage const& a, Parentage const& b)
56  {
57  return !(a == b);
58  }
59 
60 } // namespace art
bool operator==(Provenance const &a, Provenance const &b) noexcept
Definition: Provenance.cc:141
MD5Result digest() const
Definition: MD5Digest.cc:137
std::string toString() const
Definition: MD5Digest.cc:45
std::vector< ProductID > const & parents() const
Definition: Parentage.cc:36
STL namespace.
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
ParentageID id() const
Definition: Parentage.cc:25
const double a
def move(depos, offset)
Definition: depos.py:107
std::vector< ProductID > parents_
Definition: Parentage.h:34
static bool * b
Definition: config.cpp:1043