* Removed the obsolescent [B]Reference[able] API and replaced the remaining

uses. Fixes the gcc 2 acpi build.
* Renamed WeakReferenceable::{Add,Remove}Reference() to
  {Acquire,Release}Reference() for consistency.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39871 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-12-16 16:35:42 +00:00
parent 88e38c178a
commit 756b64fd83
17 changed files with 47 additions and 170 deletions
+7 -7
View File
@@ -14,7 +14,7 @@ namespace BPrivate {
template<typename Type> class WeakReferenceable;
template<typename Type>
class WeakPointer : public Referenceable {
class WeakPointer : public BReferenceable {
public:
Type* Get();
bool Put();
@@ -41,10 +41,10 @@ public:
WeakReferenceable(Type* object);
~WeakReferenceable();
void AddReference()
void AcquireReference()
{ fPointer->_GetUnchecked(); }
bool RemoveReference()
bool ReleaseReference()
{ return fPointer->Put(); }
int32 CountReferences() const
@@ -119,7 +119,7 @@ public:
if (pointer != NULL) {
fPointer = pointer;
fPointer->AddReference();
fPointer->AcquireReference();
fObject = pointer->Get();
}
}
@@ -131,7 +131,7 @@ public:
fPointer->Put();
fObject = NULL;
}
fPointer->RemoveReference();
fPointer->ReleaseReference();
fPointer = NULL;
}
}
@@ -287,7 +287,7 @@ template<typename Type>
inline
WeakReferenceable<Type>::~WeakReferenceable()
{
fPointer->RemoveReference();
fPointer->ReleaseReference();
}
@@ -295,7 +295,7 @@ template<typename Type>
inline WeakPointer<Type>*
WeakReferenceable<Type>::GetWeakPointer()
{
fPointer->AddReference();
fPointer->AcquireReference();
return fPointer;
}