InfoForTypeLabelInstance.h
Go to the documentation of this file.
1 #ifndef gallery_InfoForTypeLabelInstance_h
2 #define gallery_InfoForTypeLabelInstance_h
3 // vim: set sw=2 expandtab :
4 
5 // ===================================================================
6 // Type to facilitate lookup a product given the given module label,
7 // instance name, type and optionally the process name.
8 // ===================================================================
9 
12 
13 #include <string>
14 #include <utility>
15 #include <vector>
16 
17 class TClass;
18 
19 namespace gallery {
20 
21  using IndexProductIDPair = std::pair<unsigned int, art::ProductID>;
22 
24  public:
25  explicit InfoForTypeLabelInstance(art::TypeID const& iType,
26  std::string const& iLabel,
27  std::string const& iInstance);
28 
29  art::TypeID const& type() const noexcept;
30  std::string const& label() const noexcept;
31  std::string const& instance() const noexcept;
32 
33  TClass* tClass() const noexcept;
34  bool isAssns() const noexcept;
35  art::TypeID const& partnerType() const noexcept;
36 
37  std::vector<IndexProductIDPair>& processIndexToProductID() const noexcept;
38  std::vector<art::ProductID>& productIDsOrderedByHistory() const noexcept;
39 
40  private:
44  TClass* const tClass_;
45  bool const isAssns_;
47 
48  // There is an entry here for each process with a branch that is
49  // in the ProductRegistry and in the input file for any input file
50  // that contains events and was opened so far and the product
51  // registry entry must be associated with the Event and have a
52  // valid ProductID (the corresponding TBranch does not necessarily
53  // need to exist in the current input file). These are maintained
54  // in the order of the processIndex. The second part of the pair
55  // is an index into branchDataVector_.
56  mutable std::vector<IndexProductIDPair> processIndexToProductID_;
57 
58  // There is an entry here for each process in the current process
59  // history with a branch in the current input ROOT file. They are
60  // maintained in process history order.
61  mutable std::vector<art::ProductID> productIDsOrderedByHistory_;
62  };
63 } // namespace gallery
64 
65 #endif /* gallery_InfoForTypeLabelInstance_h */
66 
67 // Local Variables:
68 // mode: c++
69 // End:
std::pair< unsigned int, art::ProductID > IndexProductIDPair
std::string string
Definition: nybbler.cc:12
std::string const & instance() const noexcept
std::vector< IndexProductIDPair > processIndexToProductID_
std::vector< art::ProductID > & productIDsOrderedByHistory() const noexcept
std::vector< IndexProductIDPair > & processIndexToProductID() const noexcept
art::TypeID const & partnerType() const noexcept
std::string const & label() const noexcept
art::TypeID const & type() const noexcept
std::vector< art::ProductID > productIDsOrderedByHistory_
InfoForTypeLabelInstance(art::TypeID const &iType, std::string const &iLabel, std::string const &iInstance)