BranchData.h
Go to the documentation of this file.
1 #ifndef gallery_BranchData_h
2 #define gallery_BranchData_h
3 // vim: set sw=2 expandtab :
4 
5 // BranchData holds a pointer to a single TBranch and
6 // the buffer that data is written to from that TBranch.
7 
9 #include "cetlib/exempt_ptr.h"
10 
11 #include <string>
12 
13 class TBranch;
14 class TClass;
15 
16 namespace art {
17  class EDProduct;
18  class PrincipalBase;
19  class TypeID;
20 } // namespace art
21 
22 namespace gallery {
23 
24  class EventNavigator;
25 
27  public:
28  virtual ~BranchData();
29 
30  BranchData() = default;
31 
32  explicit BranchData(art::TypeID const& type,
33  TClass* iTClass,
34  TBranch* branch,
35  EventNavigator const* eventNavigator,
36  art::PrincipalBase const* finder,
37  std::string&& iBranchName);
38 
39  BranchData(BranchData const&) = delete;
40  BranchData(BranchData&&) = delete;
41  BranchData& operator=(BranchData const&) = delete;
42  BranchData& operator=(BranchData&&) = delete;
43 
44  public:
45  virtual void updateFile(TBranch* iBranch);
46 
47  TClass*
48  tClass() const noexcept
49  {
50  return tClass_;
51  }
52 
53  void*
54  address() const noexcept
55  {
56  return address_;
57  }
58 
59  TBranch*
60  branch() const noexcept
61  {
62  return branch_;
63  }
64 
65  std::string const&
66  branchName() const noexcept
67  {
68  return branchName_;
69  }
70 
71  long long
72  lastProduct() const noexcept
73  {
74  return lastProduct_;
75  }
76 
77  virtual art::EDProduct const* getIt_() const;
78  virtual art::EDProduct const* uniqueProduct_() const;
79  virtual art::EDProduct const* uniqueProduct_(art::TypeID const&) const;
80 
81  private:
82  TClass* tClass_{nullptr};
83  void* address_{nullptr};
84  art::EDProduct const* edProduct_{nullptr};
85  TBranch* branch_{nullptr};
86  EventNavigator const* eventNavigator_{nullptr};
88  mutable long long lastProduct_{-1};
89  std::string branchName_{};
90  };
91 
92 } // namespace gallery
93 
94 #endif /* gallery_BranchData_h */
95 
96 // Local Variables:
97 // mode: c++
98 // End:
std::string string
Definition: nybbler.cc:12
TBranch * branch() const noexcept
Definition: BranchData.h:60
std::string const & branchName() const noexcept
Definition: BranchData.h:66
TClass * tClass() const noexcept
Definition: BranchData.h:48
void * address() const noexcept
Definition: BranchData.h:54
long long lastProduct() const noexcept
Definition: BranchData.h:72