diff options
author | Andrew Stitcher <astitcher@apache.org> | 2012-05-22 20:16:18 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2012-05-22 20:16:18 +0000 |
commit | 921f66e37aac6f43314d4edb07e48d0ea89a16c0 (patch) | |
tree | a4eaf3ba838812f2c86780004c435252b4010ee3 /qpid/cpp/src | |
parent | 5b4f8623bd816668c3526088b1dd474f7573fcc3 (diff) | |
download | qpid-python-921f66e37aac6f43314d4edb07e48d0ea89a16c0.tar.gz |
QPID-3004: Keep the code compatible with clang C++ compiler (and probably gcc 4.7 too)
Fix up intrusive_ptr_add_ref(RefCounted*)/intrusive_ptr_release(RefCounted*) so they are
now found by argument dependent lookup.
Trivial: Added missing newline at end of file
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1341608 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r-- | qpid/cpp/src/qmf/AgentSession.cpp | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/PrivateImplRef.h | 8 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/RefCounted.h | 12 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/client/PrivateImplRef.h | 8 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/PrivateImplRef.h | 8 |
5 files changed, 17 insertions, 21 deletions
diff --git a/qpid/cpp/src/qmf/AgentSession.cpp b/qpid/cpp/src/qmf/AgentSession.cpp index 4dcbb5704f..4d7be33188 100644 --- a/qpid/cpp/src/qmf/AgentSession.cpp +++ b/qpid/cpp/src/qmf/AgentSession.cpp @@ -1028,4 +1028,4 @@ const AgentSessionImpl& AgentSessionImplAccess::get(const AgentSession& session) return *session.impl; } -}
\ No newline at end of file +} diff --git a/qpid/cpp/src/qmf/PrivateImplRef.h b/qpid/cpp/src/qmf/PrivateImplRef.h index 960cbb2e09..c0c07d7e1b 100644 --- a/qpid/cpp/src/qmf/PrivateImplRef.h +++ b/qpid/cpp/src/qmf/PrivateImplRef.h @@ -76,15 +76,15 @@ template <class T> class PrivateImplRef { /** Set the implementation pointer in a handle */ static void set(T& t, const intrusive_ptr& p) { if (t.impl == p) return; - if (t.impl) boost::intrusive_ptr_release(t.impl); + if (t.impl) intrusive_ptr_release(t.impl); t.impl = p.get(); - if (t.impl) boost::intrusive_ptr_add_ref(t.impl); + if (t.impl) intrusive_ptr_add_ref(t.impl); } // Helper functions to implement the ctor, dtor, copy, assign - static void ctor(T& t, Impl* p) { t.impl = p; if (p) boost::intrusive_ptr_add_ref(p); } + static void ctor(T& t, Impl* p) { t.impl = p; if (p) intrusive_ptr_add_ref(p); } static void copy(T& t, const T& x) { if (&t == &x) return; t.impl = 0; assign(t, x); } - static void dtor(T& t) { if(t.impl) boost::intrusive_ptr_release(t.impl); } + static void dtor(T& t) { if(t.impl) intrusive_ptr_release(t.impl); } static T& assign(T& t, const T& x) { set(t, get(x)); return t;} }; diff --git a/qpid/cpp/src/qpid/RefCounted.h b/qpid/cpp/src/qpid/RefCounted.h index f9e0107103..26e3e2c4ba 100644 --- a/qpid/cpp/src/qpid/RefCounted.h +++ b/qpid/cpp/src/qpid/RefCounted.h @@ -49,15 +49,11 @@ protected: }; -} // namespace qpid - // intrusive_ptr support. -namespace boost { -template <typename T> -inline void intrusive_ptr_add_ref(const T* p) { p->qpid::RefCounted::addRef(); } -template <typename T> -inline void intrusive_ptr_release(const T* p) { p->qpid::RefCounted::release(); } -} +inline void intrusive_ptr_add_ref(const RefCounted* p) { p->addRef(); } +inline void intrusive_ptr_release(const RefCounted* p) { p->release(); } + +} // namespace qpid #endif /*!QPID_REFCOUNTED_H*/ diff --git a/qpid/cpp/src/qpid/client/PrivateImplRef.h b/qpid/cpp/src/qpid/client/PrivateImplRef.h index 503a383c31..fa89b1bfa0 100644 --- a/qpid/cpp/src/qpid/client/PrivateImplRef.h +++ b/qpid/cpp/src/qpid/client/PrivateImplRef.h @@ -77,15 +77,15 @@ template <class T> class PrivateImplRef { static void set(T& t, const intrusive_ptr& p) { if (t.impl == p) return; - if (t.impl) boost::intrusive_ptr_release(t.impl); + if (t.impl) intrusive_ptr_release(t.impl); t.impl = p.get(); - if (t.impl) boost::intrusive_ptr_add_ref(t.impl); + if (t.impl) intrusive_ptr_add_ref(t.impl); } // Helper functions to implement the ctor, dtor, copy, assign - static void ctor(T& t, Impl* p) { t.impl = p; if (p) boost::intrusive_ptr_add_ref(p); } + static void ctor(T& t, Impl* p) { t.impl = p; if (p) intrusive_ptr_add_ref(p); } static void copy(T& t, const T& x) { if (&t == &x) return; t.impl = 0; assign(t, x); } - static void dtor(T& t) { if(t.impl) boost::intrusive_ptr_release(t.impl); } + static void dtor(T& t) { if(t.impl) intrusive_ptr_release(t.impl); } static T& assign(T& t, const T& x) { set(t, get(x)); return t;} }; diff --git a/qpid/cpp/src/qpid/messaging/PrivateImplRef.h b/qpid/cpp/src/qpid/messaging/PrivateImplRef.h index e77c58d071..a60f4eeadf 100644 --- a/qpid/cpp/src/qpid/messaging/PrivateImplRef.h +++ b/qpid/cpp/src/qpid/messaging/PrivateImplRef.h @@ -77,15 +77,15 @@ template <class T> class PrivateImplRef { /** Set the implementation pointer in a handle */ static void set(T& t, const intrusive_ptr& p) { if (t.impl == p) return; - if (t.impl) boost::intrusive_ptr_release(t.impl); + if (t.impl) intrusive_ptr_release(t.impl); t.impl = p.get(); - if (t.impl) boost::intrusive_ptr_add_ref(t.impl); + if (t.impl) intrusive_ptr_add_ref(t.impl); } // Helper functions to implement the ctor, dtor, copy, assign - static void ctor(T& t, Impl* p) { t.impl = p; if (p) boost::intrusive_ptr_add_ref(p); } + static void ctor(T& t, Impl* p) { t.impl = p; if (p) intrusive_ptr_add_ref(p); } static void copy(T& t, const T& x) { if (&t == &x) return; t.impl = 0; assign(t, x); } - static void dtor(T& t) { if(t.impl) boost::intrusive_ptr_release(t.impl); } + static void dtor(T& t) { if(t.impl) intrusive_ptr_release(t.impl); } static T& assign(T& t, const T& x) { set(t, get(x)); return t;} }; |