LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Results.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_Results_h
2 #define art_Framework_Principal_Results_h
3 // vim: set sw=2 expandtab :
4 
5 // ==================================================================
6 // This is the primary interface for accessing results-level
7 // EDProducts and inserting new results-level EDProducts.
8 //
9 // For its usage, see "art/Framework/Principal/ProductRetriever.h"
10 // ==================================================================
11 
15 
16 #include <optional>
17 
18 namespace art {
19 
20  class Results final : private ProductRetriever {
21  public:
22  ~Results();
23 
24  explicit Results(ResultsPrincipal const& p,
25  ModuleContext const& mc,
26  std::optional<ProductInserter> inserter = std::nullopt);
27 
28  Results(Results const&) = delete;
29  Results(Results&&) = delete;
30  Results& operator=(Results const&) = delete;
31  Results& operator=(Results&&) = delete;
32 
40 
44 
47 
48  // Obsolete interface (will be deprecated)
51 
52  template <typename PROD>
54  put(std::unique_ptr<PROD>&& edp, std::string const& instance = {})
55  {
56  assert(inserter_);
57  return inserter_->put(std::move(edp), instance);
58  }
59 
60  private:
61  void commitProducts();
62 
63  // Give access to commitProducts(...).
64  friend class ResultsProducer;
65 
66  std::optional<ProductInserter> inserter_;
67  };
68 
69 } // namespace art
70 
71 #endif /* art_Framework_Principal_Results_h */
72 
73 // Local Variables:
74 // mode: c++
75 // End:
bool get(SelectorBase const &, Handle< PROD > &result) const
ProductID getProductID(std::string const &instance_name="") const
std::optional< fhicl::ParameterSet const > getProcessParameterSet(std::string const &process) const
const std::string instance
void commitProducts()
Definition: Results.cc:17
std::vector< ProductToken< PROD > > getProductTokens(SelectorBase const &selector=MatchAllSelector{}) const
EDProductGetter const * productGetter(ProductID const pid) const
std::vector< InputTag > getInputTags(SelectorBase const &selector=MatchAllSelector{}) const
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Results.h:54
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Handle< PROD > getHandle(SelectorBase const &) const
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
cet::exempt_ptr< BranchDescription const > getProductDescription(ProductID) const
Definition: MVAAlg.h:12
std::optional< ProductInserter > inserter_
Definition: Results.h:66
Results(ResultsPrincipal const &p, ModuleContext const &mc, std::optional< ProductInserter > inserter=std::nullopt)
Definition: Results.cc:10
PROD const & getProduct(InputTag const &tag) const
Results & operator=(Results const &)=delete
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
std::optional< Provenance const > getProductProvenance(ProductID) const