TC::SharedPtrCount Class Reference
[Implementation Details]

Reference counter class for TC::SharedPtr. More...

#include <TCSharedPtrImpl.h>

Collaboration diagram for TC::SharedPtrCount:

Collaboration graph
[legend]

List of all members.

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.
SharedPtrCountoperator= (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::SharedPtrCountBasem_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.


Detailed Description

Reference counter class for TC::SharedPtr.

Definition at line 168 of file TCSharedPtrImpl.h.


Constructor & Destructor Documentation

TC::SharedPtrCount::SharedPtrCount (  )  [inline]

Construct without an internal counter.

Definition at line 172 of file TCSharedPtrImpl.h.

template<class PTR_TYPE , class DELETER >
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.

template<class PTR_TYPE , class DELETER >
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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class TC::WeakPtrCount [friend]

Definition at line 252 of file TCSharedPtrImpl.h.

bool operator== ( const SharedPtrCount a,
const SharedPtrCount b 
) [friend]

Compare two counters if equal.

Definition at line 238 of file TCSharedPtrImpl.h.

bool operator< ( const SharedPtrCount a,
const SharedPtrCount b 
) [friend]

Compare two counters if less.

Definition at line 244 of file TCSharedPtrImpl.h.


Member Data Documentation

Pointer to the counting object.

Definition at line 251 of file TCSharedPtrImpl.h.

Referenced by GetUseCount(), TC::WeakPtrCount::operator=(), operator=(), SharedPtrCount(), Swap(), and ~SharedPtrCount().


The documentation for this class was generated from the following file:

Copyright (c) Thomas Goessler 2003 - 2008