ProductTables.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_ProductTables_h
2 #define canvas_Persistency_Provenance_ProductTables_h
3 
6 
7 #include <array>
8 
9 namespace art {
10 
11  // A ProductTable is a collection of lookups used in retrieving
12  // (views of) products.
13 
14  struct ProductTable {
15  // A default-constructed ProductTable object represents an invalid
16  // table.
17  ProductTable() = default;
18 
19  explicit ProductTable(ProductDescriptions const& descriptions,
20  BranchType bt);
21  explicit ProductTable(ProductDescriptions const& descriptions,
22  BranchType bt,
24 
25  bool isValid{false};
28  AvailableProducts_t availableProducts{};
29  };
30 
31  // The underlying representation of ProductTables is an array of
32  // ProductTable objects: one for each BranchType value.
33  class ProductTables {
34  public:
35  static ProductTables invalid();
36  explicit ProductTables(ProductDescriptions const& descriptions);
37  explicit ProductTables(
38  ProductDescriptions const& descriptions,
39  std::array<AvailableProducts_t, NumBranchTypes> const&);
40 
41  auto const&
42  get(BranchType const bt) const
43  {
44  return tables_[bt];
45  }
46  bool
47  isValid() const
48  {
49  return isValid_;
50  }
51 
52  private:
53  explicit ProductTables() = default;
54  bool isValid_{false};
55  std::array<ProductTable, NumBranchTypes> tables_{{}};
56  };
57 }
58 
59 #endif /* canvas_Persistency_Provenance_ProductTables_h */
60 
61 // Local Variables:
62 // mode: c++
63 // End:
ProductTable()=default
AvailableProducts_t availableProducts
Definition: ProductTables.h:28
std::vector< BranchDescription > ProductDescriptions
bool isValid() const
Definition: ProductTables.h:47
ViewLookup_t viewLookup
Definition: ProductTables.h:27
ProcessLookup ViewLookup_t
Definition: type_aliases.h:17
BranchType
Definition: BranchType.h:18
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
std::unordered_set< ProductID, ProductID::Hash > AvailableProducts_t
Definition: type_aliases.h:21
ProductLookup_t productLookup
Definition: ProductTables.h:26
std::map< std::string, ProcessLookup > ProductLookup_t
Definition: type_aliases.h:20