3 #include <boost/thread.hpp> 4 #include <boost/shared_ptr.hpp> 5 #include <boost/weak_ptr.hpp> 13 typedef std::map<ProxyBase::ProxyID, boost::weak_ptr<ProxyBase> >
ProxyMap;
17 static struct Sentinel {
24 return sentinel.instance;
34 boost::mutex::scoped_lock scoped_lock(
mutex);
45 boost::mutex::scoped_lock scoped_lock(
mutex);
47 boost::shared_ptr<ProxyBase> proxy(ctor(++nextProxyID));
58 boost::mutex::scoped_lock scoped_lock(
mutex);
62 return boost::shared_ptr<ProxyBase>();
64 ProxyMap::const_iterator
pos = map->find(
id);
65 if (pos == map->end())
66 return boost::shared_ptr<ProxyBase>();
68 return boost::shared_ptr<ProxyBase>(pos->second);
static boost::mutex mutex
static boost::shared_ptr< ProxyBase > find(ProxyID id)
static PFTauRenderPlugin instance
static boost::shared_ptr< ProxyBase > create(ctor_t ctor)
static ProxyMap * getProxyMapInstance()
Container::value_type value_type
std::map< ProxyBase::ProxyID, boost::weak_ptr< ProxyBase > > ProxyMap
ProxyBase *(* ctor_t)(ProxyID id)