RPTest_plugin.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: RPTest
3 // Plugin Type: resultsproducer (art v1_15_02)
4 // File: RPTest_plugin.cc
5 //
6 // Generated at Wed Sep 16 16:59:53 2015 by Christopher Green using cetskelgen
7 // from cetlib version v1_14_00.
8 ////////////////////////////////////////////////////////////////////////
9 
17 #include "fhiclcpp/ParameterSet.h"
19 
20 #include <algorithm>
21 #include <iterator>
22 #include <set>
23 #include <sstream>
24 
25 namespace arttest {
26  class RPTest;
27 }
28 
30 public:
31  struct Config {
32  };
34  explicit RPTest(Parameters const& p);
35  // The compiler-generated destructor is fine for non-base
36  // classes without bare pointers or other resource use.
37 
38  // Plugins should not be copied or assigned.
39  RPTest(RPTest const&) = delete;
40  RPTest(RPTest&&) = delete;
41  RPTest& operator=(RPTest const&) = delete;
42  RPTest& operator=(RPTest&&) = delete;
43 
44  // Required functions.
45  void clear() override;
46  void writeResults(art::Results& res) override;
47 
48  // Selected optional functions.
49  void beginJob() override;
50  void beginRun(art::Run const& r) override;
51  void beginSubRun(art::SubRun const& sr) override;
52  void endJob() override;
53  void endRun(art::Run const& r) override;
54  void endSubRun(art::SubRun const&) override;
55  void event(art::Event const& e) override;
56  void readResults(art::Results const& res) override;
57 
58 private:
59  std::set<std::string> seenEntryPoints_;
60 };
61 
63  : seenEntryPoints_({"Constructor",
64  "clear",
65  "writeResults",
66  "beginJob",
67  "beginRun",
68  "beginSubRun",
69  "event",
70  "endJob",
71  "endRun",
72  "endSubRun",
73  "readResults"})
74 {
75  seenEntryPoints_.erase("Constructor");
76  produces<IntProduct>();
77 }
78 
79 void
81 {
82  seenEntryPoints_.erase("clear");
83 }
84 
85 void
87 {
88  seenEntryPoints_.erase("writeResults");
89  res.put(std::make_unique<IntProduct>(5.0));
90 }
91 
92 void
94 {
95  seenEntryPoints_.erase("beginJob");
96 }
97 
98 void
100 {
101  seenEntryPoints_.erase("beginRun");
102 }
103 
104 void
106 {
107  seenEntryPoints_.erase("beginSubRun");
108 }
109 
110 void
112 {
113  seenEntryPoints_.erase("endJob");
114  if (!seenEntryPoints_.empty()) {
115  std::ostringstream failed;
116  std::copy(seenEntryPoints_.cbegin(),
117  seenEntryPoints_.cend(),
118  std::ostream_iterator<std::string>(failed, " "));
120  << "Failed to hit the following entry points for ResultsProducer: "
121  << failed.str() << ".\n";
122  }
123 }
124 
125 void
127 {
128  seenEntryPoints_.erase("endRun");
129 }
130 
131 void
133 {
134  seenEntryPoints_.erase("endSubRun");
135 }
136 
137 void
139 {
140  seenEntryPoints_.erase("event");
141 }
142 
143 void
145 {
146  seenEntryPoints_.erase("readResults");
147 }
148 
RPTest & operator=(RPTest const &)=delete
void endSubRun(art::SubRun const &) override
std::set< std::string > seenEntryPoints_
Definition: Run.h:21
void event(art::Event const &e) override
const double e
#define DEFINE_ART_RESULTS_PLUGIN(klass)
void endJob() override
p
Definition: test.py:228
void writeResults(art::Results &res) override
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void beginJob() override
void endRun(art::Run const &r) override
RPTest(Parameters const &p)
T copy(T const &v)
void clear() override
void beginRun(art::Run const &r) override
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
void beginSubRun(art::SubRun const &sr) override
static const double sr
Definition: Units.h:167
void readResults(art::Results const &res) override