CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/GeneratorInterface/LHEInterface/interface/LHEProxy.h

Go to the documentation of this file.
00001 #ifndef GeneratorInterface_LHEInterface_LHEProxy_h
00002 #define GeneratorInterface_LHEInterface_LHEProxy_h
00003 
00004 #include <boost/shared_ptr.hpp>
00005 
00006 namespace lhef {
00007 
00008 // forward declarations
00009 class LHEEvent;
00010 class LHERunInfo;
00011 
00012 class LHEProxy {
00013     public:
00014         typedef unsigned long ProxyID;
00015 
00016         ~LHEProxy();
00017 
00018         const boost::shared_ptr<LHERunInfo> &getRunInfo() const
00019         { return runInfo; }
00020         const boost::shared_ptr<LHEEvent> &getEvent() const
00021         { return event; }
00022 
00023         boost::shared_ptr<LHERunInfo> releaseRunInfo()
00024         {
00025                 boost::shared_ptr<LHERunInfo> result(runInfo);
00026                 runInfo.reset();
00027                 return result;
00028         }
00029         boost::shared_ptr<LHEEvent> releaseEvent()
00030         {
00031                 boost::shared_ptr<LHEEvent> result(event);
00032                 event.reset();
00033                 return result;
00034         }
00035 
00036         void clearRunInfo() { runInfo.reset(); }
00037         void clearEvent() { event.reset(); }
00038 
00039         void loadRunInfo(const boost::shared_ptr<LHERunInfo> &runInfo)
00040         { this->runInfo = runInfo; }
00041         void loadEvent(const boost::shared_ptr<LHEEvent> &event)
00042         { this->event = event; }
00043 
00044         ProxyID getID() const { return id; }
00045 
00046         static boost::shared_ptr<LHEProxy> create();
00047         static boost::shared_ptr<LHEProxy> find(ProxyID id);
00048 
00049     private:
00050         LHEProxy(ProxyID id);
00051 
00052         // not allowed and not implemented
00053         LHEProxy(const LHEProxy &orig);
00054         LHEProxy &operator = (const LHEProxy &orig);
00055 
00056         const ProxyID                   id;
00057 
00058         boost::shared_ptr<LHERunInfo>   runInfo;
00059         boost::shared_ptr<LHEEvent>     event;
00060 };
00061 
00062 } // namespace lhef
00063 
00064 #endif // GeneratorProxy_LHEInterface_LHEProxy_h