CMS 3D CMS Logo

lhef::LHEProxy Class Reference

#include <GeneratorInterface/LHEInterface/interface/LHEProxy.h>

List of all members.

Public Types

typedef unsigned long ProxyID

Public Member Functions

void clearEvent ()
void clearRunInfo ()
const boost::shared_ptr
< LHEEvent > & 
getEvent () const
ProxyID getID () const
const boost::shared_ptr
< LHERunInfo > & 
getRunInfo () const
void loadEvent (const boost::shared_ptr< LHEEvent > &event)
void loadRunInfo (const boost::shared_ptr< LHERunInfo > &runInfo)
boost::shared_ptr< LHEEventreleaseEvent ()
boost::shared_ptr< LHERunInforeleaseRunInfo ()
 ~LHEProxy ()

Static Public Member Functions

static boost::shared_ptr
< LHEProxy
create ()
static boost::shared_ptr
< LHEProxy
find (ProxyID id)

Private Member Functions

 LHEProxy (const LHEProxy &orig)
 LHEProxy (ProxyID id)
LHEProxyoperator= (const LHEProxy &orig)

Private Attributes

boost::shared_ptr< LHEEventevent
const ProxyID id
boost::shared_ptr< LHERunInforunInfo


Detailed Description

Definition at line 12 of file LHEProxy.h.


Member Typedef Documentation

typedef unsigned long lhef::LHEProxy::ProxyID

Definition at line 14 of file LHEProxy.h.


Constructor & Destructor Documentation

LHEProxy::~LHEProxy (  ) 

Definition at line 32 of file LHEProxy.cc.

References getProxyMapInstance(), and mutex.

00033 {
00034         boost::mutex::scoped_lock scoped_lock(mutex);
00035 
00036         ProxyMap *map = getProxyMapInstance();
00037         if (map)
00038                 map->erase(id);
00039 }

LHEProxy::LHEProxy ( ProxyID  id  )  [private]

Definition at line 27 of file LHEProxy.cc.

Referenced by create().

00027                              :
00028         id(id)
00029 {
00030 }

lhef::LHEProxy::LHEProxy ( const LHEProxy orig  )  [private]


Member Function Documentation

void lhef::LHEProxy::clearEvent (  )  [inline]

Definition at line 37 of file LHEProxy.h.

00037 { event.reset(); }

void lhef::LHEProxy::clearRunInfo (  )  [inline]

Definition at line 36 of file LHEProxy.h.

References runInfo.

00036 { runInfo.reset(); }

boost::shared_ptr< LHEProxy > LHEProxy::create ( void   )  [static]

Definition at line 41 of file LHEProxy.cc.

References getProxyMapInstance(), LHEProxy(), and mutex.

Referenced by lhef::ThePEGHadronisation::ThePEGHadronisation().

00042 {
00043         static LHEProxy::ProxyID nextProxyID = 0;
00044 
00045         boost::mutex::scoped_lock scoped_lock(mutex);
00046 
00047         boost::shared_ptr<LHEProxy> proxy(new LHEProxy(++nextProxyID));
00048 
00049         ProxyMap *map = getProxyMapInstance();
00050         if (map)
00051                 map->insert(ProxyMap::value_type(proxy->getID(), proxy));
00052 
00053         return proxy;
00054 }

boost::shared_ptr< LHEProxy > LHEProxy::find ( ProxyID  id  )  [static]

Definition at line 56 of file LHEProxy.cc.

References getProxyMapInstance(), and mutex.

00057 {
00058         boost::mutex::scoped_lock scoped_lock(mutex);
00059 
00060         ProxyMap *map = getProxyMapInstance();
00061         if (!map)
00062                 return boost::shared_ptr<LHEProxy>();
00063 
00064         ProxyMap::const_iterator pos = map->find(id);
00065         if (pos == map->end())
00066                 return boost::shared_ptr<LHEProxy>();
00067 
00068         return boost::shared_ptr<LHEProxy>(pos->second);
00069 }

const boost::shared_ptr<LHEEvent>& lhef::LHEProxy::getEvent (  )  const [inline]

Definition at line 20 of file LHEProxy.h.

References event.

00021         { return event; }

ProxyID lhef::LHEProxy::getID (  )  const [inline]

Definition at line 44 of file LHEProxy.h.

References id.

00044 { return id; }

const boost::shared_ptr<LHERunInfo>& lhef::LHEProxy::getRunInfo (  )  const [inline]

Definition at line 18 of file LHEProxy.h.

References runInfo.

00019         { return runInfo; }

void lhef::LHEProxy::loadEvent ( const boost::shared_ptr< LHEEvent > &  event  )  [inline]

Definition at line 41 of file LHEProxy.h.

00042         { this->event = event; }

void lhef::LHEProxy::loadRunInfo ( const boost::shared_ptr< LHERunInfo > &  runInfo  )  [inline]

Definition at line 39 of file LHEProxy.h.

00040         { this->runInfo = runInfo; }

LHEProxy& lhef::LHEProxy::operator= ( const LHEProxy orig  )  [private]

boost::shared_ptr<LHEEvent> lhef::LHEProxy::releaseEvent (  )  [inline]

Definition at line 29 of file LHEProxy.h.

References event, and HLT_VtxMuL3::result.

00030         {
00031                 boost::shared_ptr<LHEEvent> result(event);
00032                 event.reset();
00033                 return result;
00034         }

boost::shared_ptr<LHERunInfo> lhef::LHEProxy::releaseRunInfo (  )  [inline]

Definition at line 23 of file LHEProxy.h.

References HLT_VtxMuL3::result, and runInfo.

00024         {
00025                 boost::shared_ptr<LHERunInfo> result(runInfo);
00026                 runInfo.reset();
00027                 return result;
00028         }


Member Data Documentation

boost::shared_ptr<LHEEvent> lhef::LHEProxy::event [private]

Definition at line 59 of file LHEProxy.h.

Referenced by getEvent(), and releaseEvent().

const ProxyID lhef::LHEProxy::id [private]

Definition at line 56 of file LHEProxy.h.

Referenced by getID().

boost::shared_ptr<LHERunInfo> lhef::LHEProxy::runInfo [private]

Definition at line 58 of file LHEProxy.h.

Referenced by clearRunInfo(), getRunInfo(), and releaseRunInfo().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:48:52 2009 for CMSSW by  doxygen 1.5.4