2#include <UnCompute/Memory/ReferenceCounter.h>
49 template<
class TInterface, std::enable_if_t<std::is_base_of_v<IObject, TInterface>,
bool> = true>
56 inline UInt32
Release(F&& destroyCallback)
92 m_RefCounter = pRefCounter;
Base interface for dynamic reference counted objects.
Definition: Object.h:8
virtual UInt32 Release()=0
Remove a strong reference from object's reference counter.
virtual UInt32 AddRef()=0
Add a strong reference to object's reference counter.
virtual ReferenceCounter * GetRefCounter()=0
Get reference counter that belongs to this object.
virtual void AttachRefCounter(ReferenceCounter *counter)=0
Attach a ReferenceCounter to this object.
Base class for dynamic reference counted objects.
Definition: Object.h:51
UInt32 Release() override
Definition: Object.h:82
void AttachRefCounter(ReferenceCounter *pRefCounter) override
Attach a reference counter to the object.
Definition: Object.h:90
ReferenceCounter * GetRefCounter() override
Get reference counter attached to this object.
Definition: Object.h:96
UInt32 AddRef() override
Add a strong reference to the object.
Definition: Object.h:75
The reference counter that holds the number of references to the object.
Definition: ReferenceCounter.h:41
UInt32 ReleaseStrongRef(F &&destroyCallback)
Remove a strong reference from the counter.
Definition: ReferenceCounter.h:76
UInt32 AddStrongRef()
Add a strong reference to the counter.
Definition: ReferenceCounter.h:61