hrev43630 adds 1 changeset to branch 'master' old head: 430fc0e90cb53830a39e2b87aa3ac871a68fcad5 new head: b5c5640ec03af45d19c7a0e0758c3c66d71c2095 ---------------------------------------------------------------------------- b5c5640: Style fixes. Thanks Axel and Ingo. [ czeidler <haiku@xxxxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev43630 Commit: b5c5640ec03af45d19c7a0e0758c3c66d71c2095 URL: http://cgit.haiku-os.org/haiku/commit/?id=b5c5640 Author: czeidler <haiku@xxxxxxxxxxxxxxxxxx> Date: Thu Jan 5 20:34:06 2012 UTC ---------------------------------------------------------------------------- 2 files changed, 17 insertions(+), 16 deletions(-) headers/private/shared/Referenceable.h | 4 +- headers/private/shared/WeakReferenceable.h | 29 ++++++++++++----------- ---------------------------------------------------------------------------- diff --git a/headers/private/shared/Referenceable.h b/headers/private/shared/Referenceable.h index d6d9c31..9455866 100644 --- a/headers/private/shared/Referenceable.h +++ b/headers/private/shared/Referenceable.h @@ -61,7 +61,7 @@ public: } - template <typename OtherType> + template<typename OtherType> BReference(const BReference<OtherType>& other) : fObject(NULL) @@ -131,7 +131,7 @@ public: return *this; } - template <typename OtherType> + template<typename OtherType> BReference& operator=(const BReference<OtherType>& other) { SetTo(other.Get()); diff --git a/headers/private/shared/WeakReferenceable.h b/headers/private/shared/WeakReferenceable.h index 376ae29..c09bb0c 100644 --- a/headers/private/shared/WeakReferenceable.h +++ b/headers/private/shared/WeakReferenceable.h @@ -87,7 +87,7 @@ public: SetTo(other); } - template <typename OtherType> + template<typename OtherType> BWeakReference(const BReference<OtherType>& other) : fPointer(NULL) @@ -95,7 +95,7 @@ public: SetTo(other.Get()); } - template <typename OtherType> + template<typename OtherType> BWeakReference(const BWeakReference<OtherType>& other) : fPointer(NULL) @@ -126,7 +126,7 @@ public: } } - template <typename OtherType> + template<typename OtherType> void SetTo(const BWeakReference<OtherType>& other) { // Just a compiler check if the types are compatible. @@ -136,8 +136,8 @@ public: Unset(); - if (other.Get()) { - fPointer = const_cast<WeakPointer*>(other.Get()); + if (other.PrivatePointer()) { + fPointer = const_cast<WeakPointer*>(other.PrivatePointer()); fPointer->AcquireReference(); } } @@ -172,13 +172,6 @@ public: return BReference<Type>(object, true); } - /*! Do not use this if you do not know what you are doing. The WeakPointer - is for internal use only. */ - const WeakPointer* Get() const - { - return fPointer; - } - BWeakReference& operator=(const BWeakReference<Type>& other) { if (this == &other) @@ -200,14 +193,14 @@ public: return *this; } - template <typename OtherType> + template<typename OtherType> BWeakReference& operator=(const BReference<OtherType>& other) { SetTo(other.Get()); return *this; } - template <typename OtherType> + template<typename OtherType> BWeakReference& operator=(const BWeakReference<OtherType>& other) { SetTo(other); @@ -224,6 +217,14 @@ public: return fPointer != other.fPointer; } + /*! Do not use this if you do not know what you are doing. The WeakPointer + is for internal use only. + */ + const WeakPointer* PrivatePointer() const + { + return fPointer; + } + private: WeakPointer* fPointer; };