You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2008/03/25 06:04:12 UTC
svn commit: r640702 - in /incubator/qpid/trunk/qpid/cpp/src/qpid:
cluster/Cluster.h sys/RefCountedMap.h
Author: astitcher
Date: Mon Mar 24 22:04:10 2008
New Revision: 640702
URL: http://svn.apache.org/viewvc?rev=640702&view=rev
Log:
Fixed use of intrusive_ptr in code that was missed
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h
incubator/qpid/trunk/qpid/cpp/src/qpid/sys/RefCountedMap.h
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h?rev=640702&r1=640701&r2=640702&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h Mon Mar 24 22:04:10 2008
@@ -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 @@
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 @@
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&);
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/RefCountedMap.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/RefCountedMap.h?rev=640702&r1=640701&r2=640702&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/RefCountedMap.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/RefCountedMap.h Mon Mar 24 22:04:10 2008
@@ -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 @@
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 @@
// 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 @@
~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 @@
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 @@
/** 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);