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 // $Id: SimWatcherMaker.h,v 1.1 2005/11/22 22:02:08 chrjones Exp $
20 //
21 
22 // system include files
23 #include <memory>
24 
25 // user include files
28 
29 // forward declarations
30 
31 template<class T>
33 {
34 
35  public:
37 
38  // ---------- const member functions ---------------------
39  virtual void make(const edm::ParameterSet& p,
41  boost::shared_ptr<SimWatcher>& oWatcher,
42  boost::shared_ptr<SimProducer>& oProd
43  ) const
44  {
45  boost::shared_ptr<T> returnValue(new T(p));
46  SimActivityRegistryEnroller::enroll(reg, returnValue.get());
47  oWatcher = returnValue;
48 
49  //If this is also a SimProducer, set the value
50  oProd = this->getSimProducer(returnValue.get(), returnValue);
51  }
52 
53  private:
54  boost::shared_ptr<SimProducer>
55  getSimProducer(SimProducer*, boost::shared_ptr<T>& iProd) const{
56  return boost::shared_ptr<SimProducer>(iProd);
57  }
58  boost::shared_ptr<SimProducer>
59  getSimProducer(void*, boost::shared_ptr<T>& iProd) const{
60  return boost::shared_ptr<SimProducer>();
61  }
62 
63 };
64 
65 
66 #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