TC::Impl::SharedPtrCountBase Class Reference

Base class of an shared counter implementation used by SharedPtrCount. More...

#include <TCSharedPtrImpl.h>

Inheritance diagram for TC::Impl::SharedPtrCountBase:

Inheritance graph
[legend]
Collaboration diagram for TC::Impl::SharedPtrCountBase:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

Base class of an shared counter implementation used by SharedPtrCount.

Definition at line 70 of file TCSharedPtrImpl.h.


Constructor & Destructor Documentation

virtual TC::Impl::SharedPtrCountBase::~SharedPtrCountBase (  )  [inline, protected, virtual]

Definition at line 73 of file TCSharedPtrImpl.h.

TC::Impl::SharedPtrCountBase::SharedPtrCountBase (  )  [inline, protected]

Construct reference counter with 1.

Definition at line 77 of file TCSharedPtrImpl.h.


Member Function Documentation

virtual void TC::Impl::SharedPtrCountBase::DeletePtr (  )  [protected, pure virtual]

Implemented in TC::Impl::SharedPtrCountType< T, DELETER >.

Referenced by ReleaseReference().

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:


Friends And Related Function Documentation

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.


Member Data Documentation

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


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

Copyright (c) Thomas Goessler 2003 - 2008