CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

lhef::LHEProxy Class Reference

#include <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 (ProxyID id)
 LHEProxy (const LHEProxy &orig)
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.

{
        boost::mutex::scoped_lock scoped_lock(mutex);

        ProxyMap *map = getProxyMapInstance();
        if (map)
                map->erase(id);
}
LHEProxy::LHEProxy ( ProxyID  id) [private]

Definition at line 27 of file LHEProxy.cc.

Referenced by create().

                             :
        id(id)
{
}
lhef::LHEProxy::LHEProxy ( const LHEProxy orig) [private]

Member Function Documentation

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

Definition at line 37 of file LHEProxy.h.

{ event.reset(); }
void lhef::LHEProxy::clearRunInfo ( ) [inline]

Definition at line 36 of file LHEProxy.h.

References runInfo.

{ runInfo.reset(); }
boost::shared_ptr< LHEProxy > LHEProxy::create ( void  ) [static]

Definition at line 41 of file LHEProxy.cc.

References getProxyMapInstance(), LHEProxy(), mutex, and tests::test_CacheProxy::proxy.

{
        static LHEProxy::ProxyID nextProxyID = 0;

        boost::mutex::scoped_lock scoped_lock(mutex);

        boost::shared_ptr<LHEProxy> proxy(new LHEProxy(++nextProxyID));

        ProxyMap *map = getProxyMapInstance();
        if (map)
                map->insert(ProxyMap::value_type(proxy->getID(), proxy));

        return proxy;
}
boost::shared_ptr< LHEProxy > LHEProxy::find ( ProxyID  id) [static]

Definition at line 56 of file LHEProxy.cc.

References getProxyMapInstance(), mutex, and pos.

{
        boost::mutex::scoped_lock scoped_lock(mutex);

        ProxyMap *map = getProxyMapInstance();
        if (!map)
                return boost::shared_ptr<LHEProxy>();

        ProxyMap::const_iterator pos = map->find(id);
        if (pos == map->end())
                return boost::shared_ptr<LHEProxy>();

        return boost::shared_ptr<LHEProxy>(pos->second);
}
const boost::shared_ptr<LHEEvent>& lhef::LHEProxy::getEvent ( ) const [inline]

Definition at line 20 of file LHEProxy.h.

References event.

        { return event; }
ProxyID lhef::LHEProxy::getID ( ) const [inline]

Definition at line 44 of file LHEProxy.h.

References id.

{ return id; }
const boost::shared_ptr<LHERunInfo>& lhef::LHEProxy::getRunInfo ( ) const [inline]

Definition at line 18 of file LHEProxy.h.

References runInfo.

        { return runInfo; }
void lhef::LHEProxy::loadEvent ( const boost::shared_ptr< LHEEvent > &  event) [inline]

Definition at line 41 of file LHEProxy.h.

References event.

        { this->event = event; }
void lhef::LHEProxy::loadRunInfo ( const boost::shared_ptr< LHERunInfo > &  runInfo) [inline]

Definition at line 39 of file LHEProxy.h.

References runInfo.

        { 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 query::result.

        {
                boost::shared_ptr<LHEEvent> result(event);
                event.reset();
                return result;
        }
boost::shared_ptr<LHERunInfo> lhef::LHEProxy::releaseRunInfo ( ) [inline]

Definition at line 23 of file LHEProxy.h.

References query::result, and runInfo.

        {
                boost::shared_ptr<LHERunInfo> result(runInfo);
                runInfo.reset();
                return result;
        }

Member Data Documentation

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

Definition at line 59 of file LHEProxy.h.

Referenced by getEvent(), loadEvent(), 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(), loadRunInfo(), and releaseRunInfo().