BranchKey.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_BranchKey_h
2 #define canvas_Persistency_Provenance_BranchKey_h
3 
4 /*----------------------------------------------------------------------
5 
6 BranchKey: The key used to identify a Group in the EventPrincipal. The
7 name of the branch to which the related data product will be written
8 is determined entirely from the BranchKey.
9 
10 ----------------------------------------------------------------------*/
11 
13 
14 #include <iosfwd>
15 #include <string>
16 #include <tuple>
17 
18 namespace art {
19  class BranchDescription;
20 
21  struct BranchKey;
22 
23  bool operator<(BranchKey const& a, BranchKey const& b);
24  bool operator==(BranchKey const& a, BranchKey const& b);
25  bool operator!=(BranchKey const& a, BranchKey const& b);
26 
27  std::ostream& operator<<(std::ostream& os, BranchKey const& bk);
28 }
29 
31  BranchKey() = default;
33  std::string ml,
34  std::string pin,
35  std::string pn,
37 
38  explicit BranchKey(BranchDescription const& desc);
39 
40  std::string branchName() const;
41 
47 };
48 
50  std::string ml,
51  std::string pin,
52  std::string pn,
53  BranchType const bt)
54  : friendlyClassName_{std::move(cn)}
55  , moduleLabel_{std::move(ml)}
56  , productInstanceName_{std::move(pin)}
57  , processName_{std::move(pn)}
58  , branchType_{bt}
59 {}
60 
61 inline bool
63 {
64  return std::tie(a.friendlyClassName_,
65  a.moduleLabel_,
67  a.processName_,
68  a.branchType_) < std::tie(b.friendlyClassName_,
69  b.moduleLabel_,
71  b.processName_,
72  b.branchType_);
73 }
74 
75 inline bool
77 {
78  return !(a < b || b < a);
79 }
80 
81 inline bool
83 {
84  return !(a == b);
85 }
86 
87 #endif /* canvas_Persistency_Provenance_BranchKey_h */
88 
89 // Local Variables:
90 // mode: c++
91 // End:
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
Definition: EDAnalyzer.h:184
std::string branchName() const
std::string productInstanceName_
Definition: BranchKey.h:44
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
bool operator<(ProductInfo const &a, ProductInfo const &b)
Definition: ProductInfo.h:44
std::string friendlyClassName_
Definition: BranchKey.h:42
const double a
BranchKey()=default
std::string processName_
Definition: BranchKey.h:45
const hit & b
Definition: hits.cxx:21
BranchType
Definition: BranchType.h:18
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
std::string moduleLabel_
Definition: BranchKey.h:43
bool operator==(Provenance const &a, Provenance const &b)
Definition: Provenance.h:168
enum BeamMode string