* 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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user