DeferredIsReadyWithAssnsProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: DeferredIsReadyWithAssnsProducer
3 // Module Type: producer
4 // File: DeferredIsReadyWithAssnsProducer_module.cc
5 //
6 // Generated at Wed Nov 6 17:21:54 2013 by Christopher Green using artmod
7 // from cetpkgsupport v1_04_02.
8 ////////////////////////////////////////////////////////////////////////
9 
18 #include "fhiclcpp/ParameterSet.h"
19 
20 #include <memory>
21 
22 namespace arttest {
23  class DeferredIsReadyWithAssnsProducer;
24 }
25 
27 public:
29 
30 private:
31  void produce(art::Event& e) override;
32 };
33 
35  fhicl::ParameterSet const& ps)
36  : EDProducer{ps}
37 {
38  produces<std::vector<std::string>>();
39  produces<std::vector<size_t>>();
40  produces<art::Assns<std::string, size_t, arttest::AssnTestData>>();
41 }
42 
43 void
45 {
46  std::unique_ptr<std::vector<std::string>> vs{
47  new std::vector<std::string>{"f", "e", "d", "c", "b", "a"}};
48  std::unique_ptr<std::vector<size_t>> vi{
49  new std::vector<size_t>{0, 1, 2, 3, 4, 5}};
50 
51  auto sz = vs->size();
52 
53  auto vspid(e.put(std::move(vs)));
54  auto vipid(e.put(std::move(vi)));
55 
56  std::unique_ptr<art::Assns<std::string, size_t, arttest::AssnTestData>> asid{
58  for (size_t i = 0; i != sz; ++i) {
59  asid->addSingle({vspid, sz - i - 1, e.productGetter(vspid)},
60  {vipid, i, e.productGetter(vipid)},
61  {i, i, "Ethel"});
62  }
63 
64  e.put(std::move(asid));
65 }
66 
static const double ps
Definition: Units.h:103
EDProducer()=default
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
EDProductGetter const * productGetter(ProductID const pid) const
p
Definition: test.py:228
void addSingle(Ptr< left_t > const &left, Ptr< right_t > const &right, data_t const &data)
Definition: Assns.h:496
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692