CMS 3D CMS Logo

DoodadESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DoodadESProducer
4 // Class: DoodadESProducer
5 //
13 //
14 // Original Author: Chris Jones
15 // Created: Fri Jun 24 14:33:04 EDT 2005
16 //
17 //
18 
19 // user include files
22 
23 #include "Doodad.h"
24 #include "GadgetRcd.h"
25 
26 // system include files
27 #include <memory>
28 #include <stdexcept>
29 
30 //
31 // class decleration
32 //
33 namespace edmtest {
34 
36  public:
38  ~DoodadESProducer() override;
39 
40  typedef std::unique_ptr<Doodad> ReturnType;
41 
43 
44  private:
45  // ----------member data ---------------------------
47  };
48 
49  //
50  // constants, enums and typedefs
51  //
52 
53  //
54  // static data member definitions
55 
56  //
57  // constructors and destructor
58  //
60  : exceptionInformation_(iConfig.getUntrackedParameter<bool>("throwException", false)) {
61  //the following line is needed to tell the framework what
62  // data is being produced
63  setWhatProduced(this);
64 
65  //now do what ever other initialization is needed
66  }
67 
69  // do anything here that needs to be done at desctruction time
70  // (e.g. close files, deallocate resources etc.)
71  }
72 
73  //
74  // member functions
75  //
76 
77  // ------------ method called to produce the data ------------
80  throw std::runtime_error("test exception catching");
81  }
82 
83  using namespace edmtest;
84 
85  auto pDoodad = std::make_unique<Doodad>();
86 
87  pDoodad->a = 1;
88 
89  return pDoodad;
90  }
91 } // namespace edmtest
92 
93 using namespace edmtest;
94 //define this as a plug-in
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
ReturnType produce(GadgetRcd const &)
DoodadESProducer(edm::ParameterSet const &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
std::unique_ptr< Doodad > ReturnType