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 #include <utility>
18 
19 namespace art {
20  class BranchDescription;
21 
22  struct BranchKey;
23 
24  bool operator<(BranchKey const& a, BranchKey const& b);
25  bool operator==(BranchKey const& a, BranchKey const& b);
26  bool operator!=(BranchKey const& a, BranchKey const& b);
27 
28  std::ostream& operator<<(std::ostream& os, BranchKey const& bk);
29 }
30 
32  BranchKey() = default;
34  std::string ml,
35  std::string pin,
38 
39  explicit BranchKey(BranchDescription const& desc);
40 
41  std::string branchName() const;
42 
48 };
49 
51  std::string ml,
52  std::string pin,
54  BranchType const bt)
56  , moduleLabel_{std::move(ml)}
59  , branchType_{bt}
60 {}
61 
62 inline bool
64 {
65  return std::tie(a.friendlyClassName_,
66  a.moduleLabel_,
68  a.processName_,
69  a.branchType_) < std::tie(b.friendlyClassName_,
70  b.moduleLabel_,
72  b.processName_,
73  b.branchType_);
74 }
75 
76 inline bool
78 {
79  return !(a < b || b < a);
80 }
81 
82 inline bool
84 {
85  return !(a == b);
86 }
87 
88 #endif /* canvas_Persistency_Provenance_BranchKey_h */
89 
90 // Local Variables:
91 // mode: c++
92 // End:
bool operator==(Provenance const &a, Provenance const &b) noexcept
Definition: Provenance.cc:141
std::string string
Definition: nybbler.cc:12
std::string branchName() const
Definition: BranchKey.cc:23
std::string productInstanceName_
Definition: BranchKey.h:45
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
bool operator<(ProductInfo const &a, ProductInfo const &b)
Definition: ProductInfo.cc:51
std::string friendlyClassName_
Definition: BranchKey.h:43
bt
Definition: tracks.py:83
const double a
def move(depos, offset)
Definition: depos.py:107
BranchKey()=default
std::string processName_
Definition: BranchKey.h:46
BranchType
Definition: BranchType.h:20
static bool * b
Definition: config.cpp:1043
std::string moduleLabel_
Definition: BranchKey.h:44