TReferenceCountedSmartPointer Class Template Reference
[TemplatesSmart Pointer]

Collaboration diagram for TReferenceCountedSmartPointer:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class T>
class JetByteTools::Win32::TReferenceCountedSmartPointer< T >

A template smart pointer class that manages objects that support AddRef() and Release() style reference counting.

Public Member Functions

 TReferenceCountedSmartPointer ()
 Construct an empty smart pointer.
 TReferenceCountedSmartPointer (T *ref)
 Construct a smart pointer that takes ownership of the supplied object. The pointer does NOT call AddRef() in the constructor but DOES call Release() in the destructor.
 TReferenceCountedSmartPointer (T &ref)
 Construct a smart pointer that takes ownership of the supplied object. The pointer does NOT call AddRef() in the constructor but DOES call Release() in the destructor.
 TReferenceCountedSmartPointer (const TReferenceCountedSmartPointer< T > &rhs)
TReferenceCountedSmartPointeroperator= (const TReferenceCountedSmartPointer< T > &rhs)
TReferenceCountedSmartPointeroperator= (T *ref)
 ~TReferenceCountedSmartPointer ()
T * operator-> ()
T * Get ()
const T * Get () const
T & GetRef ()
 Obtain a reference to the managed object. For some reason this DOES NOT throw an exception if the smart pointer is not currently managing an object!!
const T & GetRef () const
 Obtain a reference to the managed object. For some reason this DOES NOT throw an exception if the smart pointer is not currently managing an object!!
T * Detach ()
 Detatch the managed object from the smart pointer and return it to the caller. The caller now owns the object and is responsible for calling Release() on it when it is finished with it.
void Release ()
 Detatch the managed object from the smart pointer and call release on it. Note that it's safe to call this on an object even if it isn't currently managing an object.

Constructor & Destructor Documentation

TReferenceCountedSmartPointer (  )  [inline]

Construct an empty smart pointer.

TReferenceCountedSmartPointer ( T *  ref  )  [inline, explicit]

Construct a smart pointer that takes ownership of the supplied object. The pointer does NOT call AddRef() in the constructor but DOES call Release() in the destructor.

TReferenceCountedSmartPointer ( T &  ref  )  [inline, explicit]

Construct a smart pointer that takes ownership of the supplied object. The pointer does NOT call AddRef() in the constructor but DOES call Release() in the destructor.

TReferenceCountedSmartPointer ( const TReferenceCountedSmartPointer< T > &  rhs  )  [inline]

~TReferenceCountedSmartPointer (  )  [inline]


Member Function Documentation

TReferenceCountedSmartPointer< T > & operator= ( const TReferenceCountedSmartPointer< T > &  rhs  )  [inline]

TReferenceCountedSmartPointer< T > & operator= ( T *  ref  )  [inline]

T * operator-> (  )  [inline]

T * Get (  )  [inline]

const T * Get (  )  const [inline]

T & GetRef (  )  [inline]

Obtain a reference to the managed object. For some reason this DOES NOT throw an exception if the smart pointer is not currently managing an object!!

const T & GetRef (  )  const [inline]

Obtain a reference to the managed object. For some reason this DOES NOT throw an exception if the smart pointer is not currently managing an object!!

T * Detach (  )  [inline]

Detatch the managed object from the smart pointer and return it to the caller. The caller now owns the object and is responsible for calling Release() on it when it is finished with it.

void Release (  )  [inline]

Detatch the managed object from the smart pointer and call release on it. Note that it's safe to call this on an object even if it isn't currently managing an object.


Generated on Thu Mar 26 16:40:44 2009 for JetByte Socket Tools - v6.0 by  doxygen 1.5.3