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
53
54
55
56
57
58
59
60
61
|
#ifndef DataFormats_Provenance_ProductProvenance_h
#define DataFormats_Provenance_ProductProvenance_h
/*----------------------------------------------------------------------
ProductProvenance: The event dependent portion of the description of a product
and how it came into existence.
----------------------------------------------------------------------*/
#include "DataFormats/Provenance/interface/BranchID.h"
#include "DataFormats/Provenance/interface/ParentageID.h"
#include "DataFormats/Provenance/interface/ProvenanceFwd.h"
#include <memory>
#include <iosfwd>
#include <vector>
/*
ProductProvenance
*/
namespace edm {
class ProductProvenance {
public:
ProductProvenance();
explicit ProductProvenance(BranchID bid);
ProductProvenance(BranchID bid, ParentageID id);
ProductProvenance(BranchID bid, std::vector<BranchID> const& parents);
ProductProvenance(BranchID bid, std::vector<BranchID>&& parents);
ProductProvenance makeProductProvenance() const;
void write(std::ostream& os) const;
BranchID const& branchID() const { return branchID_; }
ParentageID const& parentageID() const { return parentageID_; }
Parentage const& parentage() const;
void set(ParentageID const& id) { parentageID_ = id; }
private:
BranchID branchID_;
ParentageID parentageID_;
};
inline bool operator<(ProductProvenance const& a, ProductProvenance const& b) { return a.branchID() < b.branchID(); }
inline std::ostream& operator<<(std::ostream& os, ProductProvenance const& p) {
p.write(os);
return os;
}
// Only the 'salient attributes' are testing in equality comparison.
bool operator==(ProductProvenance const& a, ProductProvenance const& b);
inline bool operator!=(ProductProvenance const& a, ProductProvenance const& b) { return !(a == b); }
typedef std::vector<ProductProvenance> ProductProvenanceVector;
} // namespace edm
#endif
|