LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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_{std::move(parents)}
23  {}
24 
26  Parentage::id() const
27  {
28  ostringstream oss;
29  for (auto const pid : parents_) {
30  oss << pid << ' ';
31  }
32  string const stringrep{oss.str()};
33  return ParentageID{cet::MD5Digest{stringrep}.digest().toString()};
34  }
35 
36  vector<ProductID> const&
38  {
39  return parents_;
40  }
41 
42  ostream&
43  operator<<(ostream& os, Parentage const&)
44  {
45  // Unimplemented
46  return os;
47  }
48 
49  bool
50  operator==(Parentage const& a, Parentage const& b)
51  {
52  return a.parents() == b.parents();
53  }
54 
55  bool
56  operator!=(Parentage const& a, Parentage const& b)
57  {
58  return !(a == b);
59  }
60 
61 } // namespace art
bool operator==(Provenance const &a, Provenance const &b) noexcept
Definition: Provenance.cc:141
std::vector< ProductID > const & parents() const
Definition: Parentage.cc:37
STL namespace.
bool operator!=(ScheduleID const left, ScheduleID const right) noexcept
Definition: ScheduleID.cc:41
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
ParentageID id() const
Definition: Parentage.cc:26
std::vector< ProductID > parents_
Definition: Parentage.h:32
Definition: MVAAlg.h:12