#include <Proxy.h>
Public Types | |
typedef unsigned long | ProxyID |
Public Member Functions | |
ProxyID | getID () const |
virtual | ~ProxyBase () |
Private Types | |
typedef ProxyBase *(* | ctor_t )(ProxyID id) |
Private Member Functions | |
ProxyBase & | operator= (const ProxyBase &orig) |
ProxyBase (ProxyID id) | |
ProxyBase (const ProxyBase &orig) | |
Static Private Member Functions | |
static boost::shared_ptr < ProxyBase > | create (ctor_t ctor) |
static boost::shared_ptr < ProxyBase > | find (ProxyID id) |
Private Attributes | |
const ProxyID | id |
Friends | |
class | Proxy |
typedef ProxyBase*(* ThePEG::ProxyBase::ctor_t)(ProxyID id) [private] |
typedef unsigned long ThePEG::ProxyBase::ProxyID |
Definition at line 32 of file Proxy.cc.
References getProxyMapInstance(), and mutex.
{ boost::mutex::scoped_lock scoped_lock(mutex); ProxyMap *map = getProxyMapInstance(); if (map) map->erase(id); }
ThePEG::ProxyBase::ProxyBase | ( | const ProxyBase & | orig | ) | [private] |
Definition at line 41 of file Proxy.cc.
References getProxyMapInstance(), mutex, and tests::test_CacheProxy::proxy.
{ static ProxyBase::ProxyID nextProxyID = 0; boost::mutex::scoped_lock scoped_lock(mutex); boost::shared_ptr<ProxyBase> proxy(ctor(++nextProxyID)); ProxyMap *map = getProxyMapInstance(); if (map) map->insert(ProxyMap::value_type(proxy->getID(), proxy)); return proxy; }
Reimplemented in ThePEG::Proxy< T >, and ThePEG::Proxy< Proxy >.
Definition at line 56 of file Proxy.cc.
References getProxyMapInstance(), mutex, and pos.
{ boost::mutex::scoped_lock scoped_lock(mutex); ProxyMap *map = getProxyMapInstance(); if (!map) return boost::shared_ptr<ProxyBase>(); ProxyMap::const_iterator pos = map->find(id); if (pos == map->end()) return boost::shared_ptr<ProxyBase>(); return boost::shared_ptr<ProxyBase>(pos->second); }
ProxyID ThePEG::ProxyBase::getID | ( | ) | const [inline] |
const ProxyID ThePEG::ProxyBase::id [private] |