#include <TCSharedPtrImpl.h>
Public Member Functions | |
SharedPtrCount () | |
Construct without an internal counter. | |
template<class PTR_TYPE , class DELETER > | |
SharedPtrCount (PTR_TYPE *ptr, DELETER deleter) | |
Construct with pointer and creates an pointer specific counter. | |
template<class PTR_TYPE , class DELETER > | |
SharedPtrCount (std::auto_ptr< PTR_TYPE > &ptr, DELETER deleter) | |
Construct with auto pointer and creates an pointer specific counter. | |
SharedPtrCount (const SharedPtrCount &count) | |
Copy constructor. | |
SharedPtrCount (const WeakPtrCount &count) | |
Copy constructor with a weak ptr count. | |
~SharedPtrCount () | |
Destructor releases the internal counter. | |
SharedPtrCount & | operator= (const SharedPtrCount &count) |
Assignment operator releases the old internal counter and adds a new reference to the new counter. | |
uint32 | GetUseCount () const |
Get current use count. | |
void | Swap (SharedPtrCount &a) |
Swap two shared counters. | |
Private Attributes | |
Impl::SharedPtrCountBase * | m_count |
Pointer to the counting object. | |
Friends | |
class | TC::WeakPtrCount |
bool | operator== (const SharedPtrCount &a, const SharedPtrCount &b) |
Compare two counters if equal. | |
bool | operator< (const SharedPtrCount &a, const SharedPtrCount &b) |
Compare two counters if less. |
Definition at line 168 of file TCSharedPtrImpl.h.
TC::SharedPtrCount::SharedPtrCount | ( | ) | [inline] |
TC::SharedPtrCount::SharedPtrCount | ( | PTR_TYPE * | ptr, | |
DELETER | deleter | |||
) | [inline] |
Construct with pointer and creates an pointer specific counter.
Definition at line 176 of file TCSharedPtrImpl.h.
References m_count.
TC::SharedPtrCount::SharedPtrCount | ( | std::auto_ptr< PTR_TYPE > & | ptr, | |
DELETER | deleter | |||
) | [inline] |
Construct with auto pointer and creates an pointer specific counter.
Definition at line 183 of file TCSharedPtrImpl.h.
References m_count.
TC::SharedPtrCount::SharedPtrCount | ( | const SharedPtrCount & | count | ) | [inline, explicit] |
Copy constructor.
Definition at line 190 of file TCSharedPtrImpl.h.
References TC::Impl::SharedPtrCountBase::AddReference(), and m_count.
TC::SharedPtrCount::SharedPtrCount | ( | const WeakPtrCount & | count | ) | [inline, explicit] |
Copy constructor with a weak ptr count.
Definition at line 338 of file TCSharedPtrImpl.h.
References TC::Impl::SharedPtrCountBase::AddReference(), and m_count.
TC::SharedPtrCount::~SharedPtrCount | ( | ) | [inline] |
Destructor releases the internal counter.
Definition at line 200 of file TCSharedPtrImpl.h.
References m_count, and TC::Impl::SharedPtrCountBase::ReleaseReference().
SharedPtrCount& TC::SharedPtrCount::operator= | ( | const SharedPtrCount & | count | ) | [inline] |
Assignment operator releases the old internal counter and adds a new reference to the new counter.
Definition at line 213 of file TCSharedPtrImpl.h.
References TC::Impl::SharedPtrCountBase::AddReference(), m_count, and TC::Impl::SharedPtrCountBase::ReleaseReference().
uint32 TC::SharedPtrCount::GetUseCount | ( | ) | const [inline] |
Get current use count.
Definition at line 226 of file TCSharedPtrImpl.h.
References TC::Impl::SharedPtrCountBase::GetUseCount(), and m_count.
Referenced by TC::SharedPtr< TC::MT::Semaphore >::GetUseCount(), and TC::SharedPtr< TC::MT::Semaphore >::IsUnique().
void TC::SharedPtrCount::Swap | ( | SharedPtrCount & | a | ) | [inline] |
Swap two shared counters.
Definition at line 232 of file TCSharedPtrImpl.h.
References m_count.
Referenced by TC::SharedPtr< TC::MT::Semaphore >::Swap().
friend class TC::WeakPtrCount [friend] |
Definition at line 252 of file TCSharedPtrImpl.h.
bool operator== | ( | const SharedPtrCount & | a, | |
const SharedPtrCount & | b | |||
) | [friend] |
bool operator< | ( | const SharedPtrCount & | a, | |
const SharedPtrCount & | b | |||
) | [friend] |
Pointer to the counting object.
Definition at line 251 of file TCSharedPtrImpl.h.
Referenced by GetUseCount(), TC::WeakPtrCount::operator=(), operator=(), SharedPtrCount(), Swap(), and ~SharedPtrCount().