#include <TCSharedPtrImpl.h>
Protected Member Functions | |
virtual | ~SharedPtrCountBase () |
virtual void | DeletePtr ()=0 |
SharedPtrCountBase () | |
Construct reference counter with 1. | |
Private Member Functions | |
void | AddReference () |
Add a new reference to this counter. | |
void | ReleaseReference () |
Release the reference of this counter If last reference it deletes itself. | |
uint32 | GetUseCount () const |
Get current usage count. | |
void | AddWeakReference () |
Add a new weak reference to this counter. | |
void | ReleaseWeakReference () |
Release the weak reference of this counter If last reference it deletes itself. | |
void | Destroy () |
function which destroys the counter and should be called when no more references | |
Private Attributes | |
Interlocked::Type | m_count |
The counting variable. | |
Interlocked::Type | m_weak_count |
The weak pointer counting variable. | |
Friends | |
class | TC::SharedPtrCount |
class | TC::WeakPtrCount |
Definition at line 70 of file TCSharedPtrImpl.h.
virtual TC::Impl::SharedPtrCountBase::~SharedPtrCountBase | ( | ) | [inline, protected, virtual] |
Definition at line 73 of file TCSharedPtrImpl.h.
TC::Impl::SharedPtrCountBase::SharedPtrCountBase | ( | ) | [inline, protected] |
virtual void TC::Impl::SharedPtrCountBase::DeletePtr | ( | ) | [protected, pure virtual] |
Implemented in TC::Impl::SharedPtrCountType< T, DELETER >.
Referenced by ReleaseReference().
void TC::Impl::SharedPtrCountBase::AddReference | ( | ) | [inline, private] |
Add a new reference to this counter.
Definition at line 85 of file TCSharedPtrImpl.h.
References TC::Interlocked::Increment(), and m_count.
Referenced by TC::SharedPtrCount::operator=(), and TC::SharedPtrCount::SharedPtrCount().
void TC::Impl::SharedPtrCountBase::ReleaseReference | ( | ) | [inline, private] |
Release the reference of this counter If last reference it deletes itself.
Definition at line 93 of file TCSharedPtrImpl.h.
References TC::Interlocked::Decrement(), DeletePtr(), m_count, and ReleaseWeakReference().
Referenced by TC::SharedPtrCount::operator=(), and TC::SharedPtrCount::~SharedPtrCount().
uint32 TC::Impl::SharedPtrCountBase::GetUseCount | ( | ) | const [inline, private] |
Get current usage count.
Definition at line 102 of file TCSharedPtrImpl.h.
References m_count.
Referenced by TC::WeakPtrCount::GetUseCount(), and TC::SharedPtrCount::GetUseCount().
void TC::Impl::SharedPtrCountBase::AddWeakReference | ( | ) | [inline, private] |
Add a new weak reference to this counter.
Definition at line 105 of file TCSharedPtrImpl.h.
References TC::Interlocked::Increment(), and m_weak_count.
Referenced by TC::WeakPtrCount::operator=(), and TC::WeakPtrCount::WeakPtrCount().
void TC::Impl::SharedPtrCountBase::ReleaseWeakReference | ( | ) | [inline, private] |
Release the weak reference of this counter If last reference it deletes itself.
Definition at line 113 of file TCSharedPtrImpl.h.
References TC::Interlocked::Decrement(), Destroy(), and m_weak_count.
Referenced by TC::WeakPtrCount::operator=(), ReleaseReference(), and TC::WeakPtrCount::~WeakPtrCount().
void TC::Impl::SharedPtrCountBase::Destroy | ( | ) | [inline, private] |
function which destroys the counter and should be called when no more references
Definition at line 125 of file TCSharedPtrImpl.h.
Referenced by ReleaseWeakReference().
friend class TC::SharedPtrCount [friend] |
Reimplemented in TC::Impl::SharedPtrCountType< T, DELETER >.
Definition at line 133 of file TCSharedPtrImpl.h.
friend class TC::WeakPtrCount [friend] |
Definition at line 134 of file TCSharedPtrImpl.h.
The counting variable.
Definition at line 129 of file TCSharedPtrImpl.h.
Referenced by AddReference(), GetUseCount(), and ReleaseReference().
The weak pointer counting variable.
Definition at line 131 of file TCSharedPtrImpl.h.
Referenced by AddWeakReference(), and ReleaseWeakReference().