OPTPP::SmartPtr< T > Class Template Reference

Howard Hinnant's reference counting handle class. More...

List of all members.

Public Member Functions

bool isNonUnique () const
bool isNull () const
 operator const T * () const
const T & operator* () const
T & operator* ()
const T * operator-> () const
T * operator-> ()
const SmartPtr< T > & operator= (const SmartPtr< T > &rhs)
int refCount () const
 SmartPtr (const SmartPtr< T > &other)
 SmartPtr (T *ptr=0)

Protected Attributes

T * ptr_
int * refCount_

Detailed Description

template<class T>
class OPTPP::SmartPtr< T >

Howard Hinnant's reference counting handle class.

This is to be used as a pointer to class T. This will feel and smell just like a built-in pointer except: 1. There is no need to call delete on the pointer. 2. The default copy constructor and assignment implement ref-counting. 3. The user may call isNonUnique to determine if this pointer is the only pointer to the data. This can be used to hide the ref-counting behavior of a class. 4. Checks for dereference of a null pointer.

Definition at line 23 of file OptppSmartPtr.h.


The documentation for this class was generated from the following file:
Generated on Mon Jan 24 12:04:41 2011 for FASTlib by  doxygen 1.6.3