BranchMapper.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_BranchMapper_h
2 #define canvas_Persistency_Provenance_BranchMapper_h
3 
4 // ======================================================================
5 //
6 // BranchMapper: Manages the per event/subRun/run per product provenance.
7 //
8 // ======================================================================
9 
13 #include "cetlib/exempt_ptr.h"
14 #include "cetlib/value_ptr.h"
15 
16 #include <iosfwd>
17 #include <map>
18 #include <memory>
19 #include <set>
20 
21 namespace art {
22  // defined below:
23  class BranchMapper;
24  std::ostream& operator<<(std::ostream&, BranchMapper const&);
25 
26  // forward declaration:
27  class ProductID;
28 }
29 
30 // ----------------------------------------------------------------------
31 
33 public:
34  BranchMapper(BranchMapper const&) = delete;
35  BranchMapper& operator=(BranchMapper const&) = delete;
36 
38 
39  explicit BranchMapper(bool delayedRead = false);
40  virtual ~BranchMapper() = default;
41 
42  void write(std::ostream&) const;
43 
45  result_t insert(std::unique_ptr<ProductProvenance const>&&);
46 
47  void
48  setDelayedRead(bool const value)
49  {
51  }
52 
53 private:
54  using eiSet = std::map<ProductID, cet::value_ptr<ProductProvenance const>>;
55 
57  mutable bool delayedRead_;
58 
59  void readProvenance() const;
60  virtual void
62  {}
63 
64 }; // BranchMapper
65 
66 inline std::ostream&
67 art::operator<<(std::ostream& os, BranchMapper const& p)
68 {
69  p.write(os);
70  return os;
71 }
72 
73 // ======================================================================
74 
75 #endif /* canvas_Persistency_Provenance_BranchMapper_h */
76 
77 // Local Variables:
78 // mode: c++
79 // End:
void write(std::ostream &) const
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
Definition: EDAnalyzer.h:184
std::map< ProductID, cet::value_ptr< ProductProvenance const >> eiSet
Definition: BranchMapper.h:54
const char * p
Definition: xmltok.h:285
result_t insert(std::unique_ptr< ProductProvenance const > &&)
virtual void readProvenance_() const
Definition: BranchMapper.h:61
result_t branchToProductProvenance(ProductID const) const
BranchMapper & operator=(BranchMapper const &)=delete
const XML_Char int const XML_Char * value
Definition: expat.h:331
void setDelayedRead(bool const value)
Definition: BranchMapper.h:48
void readProvenance() const
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
BranchMapper(BranchMapper const &)=delete
virtual ~BranchMapper()=default