-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
StableProvenance.cc
52 lines (40 loc) · 1.53 KB
/
StableProvenance.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "DataFormats/Provenance/interface/StableProvenance.h"
#include "DataFormats/Provenance/interface/ProcessConfiguration.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include <algorithm>
#include <cassert>
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
namespace edm {
StableProvenance::StableProvenance() : StableProvenance{std::shared_ptr<BranchDescription const>(), ProductID()} {
}
StableProvenance::StableProvenance(std::shared_ptr<BranchDescription const> const& p, ProductID const& pid) :
branchDescription_(p),
productID_(pid),
processHistory_() {
}
bool
StableProvenance::getProcessConfiguration(ProcessConfiguration& pc) const {
return processHistory_->getConfigurationForProcess(processName(), pc);
}
ReleaseVersion
StableProvenance::releaseVersion() const {
ProcessConfiguration pc;
assert(getProcessConfiguration(pc));
return pc.releaseVersion();
}
void
StableProvenance::write(std::ostream& os) const {
// This is grossly inadequate, but it is not critical for the first pass.
branchDescription().write(os);
}
bool operator==(StableProvenance const& a, StableProvenance const& b) {
return a.branchDescription() == b.branchDescription();
}
void
StableProvenance::swap(StableProvenance& iOther) {
branchDescription_.swap(iOther.branchDescription_);
productID_.swap(iOther.productID_);
std::swap(processHistory_, iOther.processHistory_);
}
}