summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2008-03-25 05:04:10 +0000
committerAndrew Stitcher <astitcher@apache.org>2008-03-25 05:04:10 +0000
commitbb542cee9af73a016360aa2d00addfee0206cad8 (patch)
tree411230112aa4fecfedfb0cef8af57a9e6c797b76
parentf7aafe13e5c2a8fe39fd89c7c4d53b0d9687f7ce (diff)
downloadqpid-python-bb542cee9af73a016360aa2d00addfee0206cad8.tar.gz
Fixed use of intrusive_ptr in code that was missed
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@640702 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/cluster/Cluster.h5
-rw-r--r--cpp/src/qpid/sys/RefCountedMap.h13
2 files changed, 10 insertions, 8 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h
index 733db8003d..1b0c1b1689 100644
--- a/cpp/src/qpid/cluster/Cluster.h
+++ b/cpp/src/qpid/cluster/Cluster.h
@@ -31,6 +31,7 @@
#include <boost/optional.hpp>
#include <boost/function.hpp>
+#include <boost/intrusive_ptr.hpp>
#include <map>
#include <vector>
@@ -62,7 +63,7 @@ class Cluster : private sys::Runnable, private Cpg::Handler
virtual ~Cluster();
// FIXME aconway 2008-01-29:
- intrusive_ptr<broker::PreviewSessionManager::Observer> getObserver() { return observer; }
+ boost::intrusive_ptr<broker::PreviewSessionManager::Observer> getObserver() { return observer; }
/** Get the current cluster membership. */
MemberList getMembers() const;
@@ -116,7 +117,7 @@ class Cluster : private sys::Runnable, private Cpg::Handler
MemberMap members;
sys::Thread dispatcher;
boost::function<void()> callback;
- intrusive_ptr<broker::PreviewSessionManager::Observer> observer;
+ boost::intrusive_ptr<broker::PreviewSessionManager::Observer> observer;
friend std::ostream& operator <<(std::ostream&, const Cluster&);
friend std::ostream& operator <<(std::ostream&, const MemberMap::value_type&);
diff --git a/cpp/src/qpid/sys/RefCountedMap.h b/cpp/src/qpid/sys/RefCountedMap.h
index 7db1d34953..2186e61b15 100644
--- a/cpp/src/qpid/sys/RefCountedMap.h
+++ b/cpp/src/qpid/sys/RefCountedMap.h
@@ -28,6 +28,7 @@
#include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/cast.hpp>
+#include <boost/intrusive_ptr.hpp>
#include <vector>
#include <map>
#include <algorithm>
@@ -52,7 +53,7 @@ class RefCountedMapData : public Base {
private:
friend class RefCountedMap<Key, Data, Impl>;
- intrusive_ptr<Map> map;
+ boost::intrusive_ptr<Map> map;
typename Impl::iterator self;
public:
@@ -79,7 +80,7 @@ class RefCountedMap : public RefCountedChild {
// Acquire the lock and ensure map is not deleted before unlock.
class Lock {
- intrusive_ptr<const RefCountedMap> map;
+ boost::intrusive_ptr<const RefCountedMap> map;
sys::Mutex::ScopedLock lock;
public:
Lock(const RefCountedMap* m) : map(m), lock(m->lock) {}
@@ -100,13 +101,13 @@ class RefCountedMap : public RefCountedChild {
~RefCountedMap() {}
/** Return 0 if not found */
- intrusive_ptr<Data> find(const Key& k) {
+ boost::intrusive_ptr<Data> find(const Key& k) {
Lock l(this);
iterator i = map.find(k);
return (i == map.end()) ? 0 : i->second;
}
- bool insert(const Key& k, intrusive_ptr<Data> d) {
+ bool insert(const Key& k, boost::intrusive_ptr<Data> d) {
Lock l(this);
iterator i;
bool inserted;
@@ -132,7 +133,7 @@ class RefCountedMap : public RefCountedChild {
template <class F> void clear(F functor) {
Lock l(this);
while (!map.empty()) {
- intrusive_ptr<Data> ptr;
+ boost::intrusive_ptr<Data> ptr;
if (map.empty()) return;
ptr = map.begin()->second;
detach(map.begin());
@@ -143,7 +144,7 @@ class RefCountedMap : public RefCountedChild {
/** Apply functor to each map entry. */
template <class F> void apply(F functor) {
- std::vector<intrusive_ptr<Data> > snapshot;
+ std::vector<boost::intrusive_ptr<Data> > snapshot;
{
// Take a snapshot referencing all values in map.
Lock l(this);