RefCounterPtr< T, RetT > Class Template Reference

Reference-counting object, behaves as a pointer, works on RefCounter-derived types. More...

#include <refcounter.h>

Inherits RefCounterPtrBase.

Inheritance diagram for RefCounterPtr< T, RetT >:

Inheritance graph
[legend]
Collaboration diagram for RefCounterPtr< T, RetT >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RefCounterPtr (void)
 RefCounterPtr (T *t)
 RefCounterPtr (const RefCounterPtr< T, RetT > &t)
 ~RefCounterPtr (void)
RefCounterPtroperator= (T *t)
RefCounterPtroperator= (const RefCounterPtr< T, RetT > &t)
RetT & operator * (void) const
 reference access
RetT * operator-> (void) const
 pointer access
 operator RetT * (void) const
 conversion - allow automatic conversion to type RetT*
bool operator! (void) const
 negation
bool operator== (const RefCounterPtr< T, RetT > &t) const
 equivalence with another RefCounterPtr object
bool operator== (T *t) const
 equivalence with pointer
bool isValid (void) const

Protected Attributes

T * mPtr
 pointer, that this class guards

Detailed Description

template<class T, class RetT = T>
class RefCounterPtr< T, RetT >

Reference-counting object, behaves as a pointer, works on RefCounter-derived types.

The first template argument (denotet as T) is the type with it is going to treat as with RefCounter object. The second template argument (denoted as RetT) is the type we want to publish with this RefCounter object. "Publish" means that the result of access operators (operator *, operator ->, operator RetT*) is of type RetT. This all is due to classes (passed to T), that are derived from RefCounter class and wrap or refer to some object of type RetT. In that cases we want to access RetT and not the wrapper-class.

Definition at line 102 of file refcounter.h.


Constructor & Destructor Documentation

template<class T, class RetT = T>
RefCounterPtr< T, RetT >::RefCounterPtr void   )  [inline]
 

Definition at line 110 of file refcounter.h.

template<class T, class RetT = T>
RefCounterPtr< T, RetT >::RefCounterPtr T *  t  )  [inline]
 

Definition at line 114 of file refcounter.h.

template<class T, class RetT = T>
RefCounterPtr< T, RetT >::RefCounterPtr const RefCounterPtr< T, RetT > &  t  )  [inline]
 

Definition at line 118 of file refcounter.h.

template<class T, class RetT = T>
RefCounterPtr< T, RetT >::~RefCounterPtr void   )  [inline]
 

Definition at line 122 of file refcounter.h.

References RefCounterPtrBase::decRef(), and RefCounterPtr< T, RetT >::mPtr.

Here is the call graph for this function:


Member Function Documentation

template<class T, class RetT = T>
bool RefCounterPtr< T, RetT >::isValid void   )  const [inline]
 

Definition at line 166 of file refcounter.h.

References RefCounterPtr< T, RetT >::mPtr.

template<class T, class RetT = T>
RetT& RefCounterPtr< T, RetT >::operator * void   )  const [inline]
 

reference access

Definition at line 143 of file refcounter.h.

References assertL, and RefCounterPtr< T, RetT >::mPtr.

Referenced by RefCounterPtr< T, RetT >::operator RetT *(), and RefCounterPtr< T, RetT >::operator->().

template<class T, class RetT = T>
RefCounterPtr< T, RetT >::operator RetT * void   )  const [inline]
 

conversion - allow automatic conversion to type RetT*

Definition at line 151 of file refcounter.h.

References assertL, RefCounterPtr< T, RetT >::mPtr, and RefCounterPtr< T, RetT >::operator *().

Here is the call graph for this function:

template<class T, class RetT = T>
bool RefCounterPtr< T, RetT >::operator! void   )  const [inline]
 

negation

Definition at line 155 of file refcounter.h.

References RefCounterPtr< T, RetT >::mPtr.

template<class T, class RetT = T>
RetT* RefCounterPtr< T, RetT >::operator-> void   )  const [inline]
 

pointer access

Definition at line 147 of file refcounter.h.

References assertL, RefCounterPtr< T, RetT >::mPtr, and RefCounterPtr< T, RetT >::operator *().

Here is the call graph for this function:

template<class T, class RetT = T>
RefCounterPtr& RefCounterPtr< T, RetT >::operator= const RefCounterPtr< T, RetT > &  t  )  [inline]
 

Definition at line 135 of file refcounter.h.

References RefCounterPtrBase::decRef(), RefCounterPtrBase::incRef(), and RefCounterPtr< T, RetT >::mPtr.

Here is the call graph for this function:

template<class T, class RetT = T>
RefCounterPtr& RefCounterPtr< T, RetT >::operator= T *  t  )  [inline]
 

Definition at line 127 of file refcounter.h.

References RefCounterPtrBase::decRef(), RefCounterPtrBase::incRef(), and RefCounterPtr< T, RetT >::mPtr.

Here is the call graph for this function:

template<class T, class RetT = T>
bool RefCounterPtr< T, RetT >::operator== T *  t  )  const [inline]
 

equivalence with pointer

Definition at line 163 of file refcounter.h.

References RefCounterPtr< T, RetT >::mPtr.

template<class T, class RetT = T>
bool RefCounterPtr< T, RetT >::operator== const RefCounterPtr< T, RetT > &  t  )  const [inline]
 

equivalence with another RefCounterPtr object

Definition at line 159 of file refcounter.h.

References RefCounterPtr< T, RetT >::mPtr.


Member Data Documentation

template<class T, class RetT = T>
T* RefCounterPtr< T, RetT >::mPtr [protected]
 

pointer, that this class guards

Definition at line 105 of file refcounter.h.

Referenced by RefCounterPtr< T, RetT >::isValid(), RefCounterPtr< T, RetT >::operator *(), RefCounterPtr< T, RetT >::operator RetT *(), RefCounterPtr< T, RetT >::operator!(), RefCounterPtr< T, RetT >::operator->(), RefCounterPtr< T, RetT >::operator=(), RefCounterPtr< T, RetT >::operator==(), and RefCounterPtr< T, RetT >::~RefCounterPtr().


The documentation for this class was generated from the following file:
Generated on Wed Apr 12 14:21:26 2006 for bjs by  doxygen 1.4.5