CMS 3D CMS Logo

LHEProxy.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_LHEInterface_LHEProxy_h
2 #define GeneratorInterface_LHEInterface_LHEProxy_h
3 
4 #include <boost/shared_ptr.hpp>
5 
6 namespace lhef {
7 
8 // forward declarations
9 class LHEEvent;
10 class LHERunInfo;
11 
12 class LHEProxy {
13  public:
14  typedef unsigned long ProxyID;
15 
16  ~LHEProxy();
17 
18  const boost::shared_ptr<LHERunInfo> &getRunInfo() const
19  { return runInfo; }
20  const boost::shared_ptr<LHEEvent> &getEvent() const
21  { return event; }
22 
23  boost::shared_ptr<LHERunInfo> releaseRunInfo()
24  {
25  boost::shared_ptr<LHERunInfo> result(runInfo);
26  runInfo.reset();
27  return result;
28  }
29  boost::shared_ptr<LHEEvent> releaseEvent()
30  {
31  boost::shared_ptr<LHEEvent> result(event);
32  event.reset();
33  return result;
34  }
35 
36  void clearRunInfo() { runInfo.reset(); }
37  void clearEvent() { event.reset(); }
38 
39  void loadRunInfo(const boost::shared_ptr<LHERunInfo> &runInfo)
40  { this->runInfo = runInfo; }
41  void loadEvent(const boost::shared_ptr<LHEEvent> &event)
42  { this->event = event; }
43 
44  ProxyID getID() const { return id; }
45 
46  static boost::shared_ptr<LHEProxy> create();
47  static boost::shared_ptr<LHEProxy> find(ProxyID id);
48 
49  private:
50  LHEProxy(ProxyID id);
51 
52  // not allowed and not implemented
53  LHEProxy(const LHEProxy &orig) = delete;
54  LHEProxy &operator = (const LHEProxy &orig) = delete;
55 
56  const ProxyID id;
57 
58  boost::shared_ptr<LHERunInfo> runInfo;
59  boost::shared_ptr<LHEEvent> event;
60 };
61 
62 } // namespace lhef
63 
64 #endif // GeneratorProxy_LHEInterface_LHEProxy_h
LHEProxy & operator=(const LHEProxy &orig)=delete
const ProxyID id
Definition: LHEProxy.h:56
void clearEvent()
Definition: LHEProxy.h:37
LHEProxy(ProxyID id)
Definition: LHEProxy.cc:27
const boost::shared_ptr< LHEEvent > & getEvent() const
Definition: LHEProxy.h:20
ProxyID getID() const
Definition: LHEProxy.h:44
boost::shared_ptr< LHEEvent > event
Definition: LHEProxy.h:59
const boost::shared_ptr< LHERunInfo > & getRunInfo() const
Definition: LHEProxy.h:18
void loadEvent(const boost::shared_ptr< LHEEvent > &event)
Definition: LHEProxy.h:41
boost::shared_ptr< LHEEvent > releaseEvent()
Definition: LHEProxy.h:29
unsigned long ProxyID
Definition: LHEProxy.h:14
boost::shared_ptr< LHERunInfo > runInfo
Definition: LHEProxy.h:58
void loadRunInfo(const boost::shared_ptr< LHERunInfo > &runInfo)
Definition: LHEProxy.h:39
boost::shared_ptr< LHERunInfo > releaseRunInfo()
Definition: LHEProxy.h:23
void clearRunInfo()
Definition: LHEProxy.h:36
Definition: event.py:1
static boost::shared_ptr< LHEProxy > find(ProxyID id)
Definition: LHEProxy.cc:56
static boost::shared_ptr< LHEProxy > create()
Definition: LHEProxy.cc:41