LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
DeferredProductGetter.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_DeferredProductGetter_h
2 #define art_Framework_Principal_DeferredProductGetter_h
3 
5 #include "art/Utilities/fwd.h"
8 #include "cetlib/exempt_ptr.h"
9 
11 public:
12  DeferredProductGetter(cet::exempt_ptr<Principal const> groupFinder,
13  ProductID pid);
14 
15  bool isReady() const override;
16  EDProduct const* getIt() const override;
17  EDProduct const* anyProduct() const override;
18  EDProduct const* uniqueProduct() const override;
19  EDProduct const* uniqueProduct(TypeID const&) const override;
20  bool resolveProduct(TypeID const&) const override;
21  bool resolveProductIfAvailable(TypeID const&) const override;
22 
23 private:
24  cet::exempt_ptr<EDProductGetter const> resolveGetter_() const;
25  cet::exempt_ptr<EDProductGetter const> maybeResolveGetter_() const;
26 
27  cet::exempt_ptr<Principal const> groupFinder_;
28  ProductID const pid_;
29  mutable cet::exempt_ptr<EDProductGetter const> realGetter_;
30 }; // EDProductGetter
31 
32 inline bool
34 {
35  return (maybeResolveGetter_() != nullptr) && realGetter_->isReady();
36 }
37 
38 #endif /* art_Framework_Principal_DeferredProductGetter_h */
39 
40 // Local Variables:
41 // mode: c++
42 // End:
cet::exempt_ptr< EDProductGetter const > resolveGetter_() const
EDProduct const * getIt() const override
cet::exempt_ptr< EDProductGetter const > maybeResolveGetter_() const
bool isReady() const override
EDProduct const * anyProduct() const override
DeferredProductGetter(cet::exempt_ptr< Principal const > groupFinder, ProductID pid)
cet::exempt_ptr< EDProductGetter const > realGetter_
EDProduct const * uniqueProduct() const override
bool resolveProduct(TypeID const &) const override
cet::exempt_ptr< Principal const > groupFinder_
bool resolveProductIfAvailable(TypeID const &) const override