LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
RPWorker.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_RPWorker_h
2 #define art_Framework_Principal_RPWorker_h
3 // vim: set sw=2 expandtab :
5 // RPWorker
6 //
7 // "Worker"-style wrapper base class for ResultsProducers.
8 //
9 // Allows for access to particular parameters and module descriptions
10 // without their having to be passed via the ResultsProducer
11 // constructor.
13 
16 
17 namespace art {
18 
19  class ResultsProducer;
20 
21  class RPWorker {
22 
23  public:
24  virtual ~RPWorker() = default;
25 
26  RPWorker(RPParams const& p);
27 
28  public:
30 
31  ResultsProducer const& rp() const;
32 
33  RPParams const& params() const;
34 
35  ModuleDescription const& moduleDescription() const;
36 
38 
40 
41  private:
42  virtual ResultsProducer& rp_() = 0;
43 
44  virtual ResultsProducer const& rp_() const = 0;
45 
46  private:
48 
50  };
51 
52  inline RPWorker::RPWorker(RPParams const& p) : p_(p), md_() {}
53 
54  inline ResultsProducer&
56  {
57  return rp_();
58  }
59 
60  inline ResultsProducer const&
61  RPWorker::rp() const
62  {
63  return rp_();
64  }
65 
66  inline RPParams const&
68  {
69  return p_;
70  }
71 
72  inline ModuleDescription const&
74  {
75  return md_;
76  }
77 
78  inline void
80  {
81  md_ = md;
82  }
83 
84  inline void
86  {
87  md_ = std::move(md);
88  }
89 
90 } // namespace art
91 
92 #endif /* art_Framework_Principal_RPWorker_h */
93 
94 // Local Variables:
95 // mode: c++
96 // End:
virtual ~RPWorker()=default
ModuleDescription const & moduleDescription() const
Definition: RPWorker.h:73
ResultsProducer & rp()
Definition: RPWorker.h:55
ModuleDescription md_
Definition: RPWorker.h:49
void setModuleDescription(ModuleDescription const &)
Definition: RPWorker.h:79
RPParams const & params() const
Definition: RPWorker.h:67
virtual ResultsProducer & rp_()=0
RPParams p_
Definition: RPWorker.h:47
RPWorker(RPParams const &p)
Definition: RPWorker.h:52
Definition: MVAAlg.h:12