CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimWatcherMaker.h
Go to the documentation of this file.
1 #ifndef Watcher_SimWatcherMaker_h
2 #define Watcher_SimWatcherMaker_h
3 // -*- C++ -*-
4 //
5 // Package: Watcher
6 // Class : SimWatcherMaker
7 //
16 //
17 // Original Author:
18 // Created: Tue Nov 22 13:03:44 EST 2005
19 //
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
27 
28 // forward declarations
29 
30 template<class T>
32 {
33 
34  public:
36 
37  // ---------- const member functions ---------------------
38  virtual void make(const edm::ParameterSet& p,
40  boost::shared_ptr<SimWatcher>& oWatcher,
41  boost::shared_ptr<SimProducer>& oProd
42  ) const
43  {
44  boost::shared_ptr<T> returnValue(new T(p));
45  SimActivityRegistryEnroller::enroll(reg, returnValue.get());
46  oWatcher = returnValue;
47 
48  //If this is also a SimProducer, set the value
49  oProd = this->getSimProducer(returnValue.get(), returnValue);
50  }
51 
52  private:
53  boost::shared_ptr<SimProducer>
54  getSimProducer(SimProducer*, boost::shared_ptr<T>& iProd) const{
55  return boost::shared_ptr<SimProducer>(iProd);
56  }
57  boost::shared_ptr<SimProducer>
58  getSimProducer(void*, boost::shared_ptr<T>& iProd) const{
59  return boost::shared_ptr<SimProducer>();
60  }
61 
62 };
63 
64 
65 #endif
boost::shared_ptr< SimProducer > getSimProducer(SimProducer *, boost::shared_ptr< T > &iProd) const
static void enroll(SimActivityRegistry &iReg, T *iObj)
boost::shared_ptr< SimProducer > getSimProducer(void *, boost::shared_ptr< T > &iProd) const
virtual void make(const edm::ParameterSet &p, SimActivityRegistry &reg, boost::shared_ptr< SimWatcher > &oWatcher, boost::shared_ptr< SimProducer > &oProd) const
long double T