LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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;
32  BranchKey(std::string cn,
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 
42  std::string friendlyClassName_{};
43  std::string moduleLabel_{};
44  std::string productInstanceName_{};
45  std::string processName_{};
47 };
48 
49 inline art::BranchKey::BranchKey(std::string cn,
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
62 art::operator<(BranchKey const& a, BranchKey const& b)
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
76 art::operator==(BranchKey const& a, BranchKey const& b)
77 {
78  return !(a < b || b < a);
79 }
80 
81 inline bool
82 art::operator!=(BranchKey const& a, BranchKey const& b)
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
Definition: BranchKey.cc:23
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
BranchKey()=default
std::string processName_
Definition: BranchKey.h:45
BranchType
Definition: BranchType.h:18
HLT enums.
std::string moduleLabel_
Definition: BranchKey.h:43
bool operator==(Provenance const &a, Provenance const &b)
Definition: Provenance.h:168