#include <TCScopedPtr.h>
Public Types | |
typedef T *ThisType::* | unspecified_bool_type |
Public Member Functions | |
ScopedPtr () | |
Construct the object pointing to a 0 object. | |
ScopedPtr (T *ptr) | |
Construct the object pointing to a specified object. | |
ScopedPtr (std::auto_ptr< T > ptr) | |
Construct the object pointing to a specified std::auto_ptr. | |
~ScopedPtr () | |
Destructor deletes the pointer. | |
const T * | operator-> () const |
User define conversion to the const Template pointer type. | |
T * | operator-> () |
User define conversion to the Template pointer type. | |
operator unspecified_bool_type () const | |
User define conversion for if like "if (pointer)". | |
bool | operator! () const |
User define conversion for if like "if (!pointer)". | |
Private Types | |
typedef ScopedPtr< T > | ThisType |
Private Attributes | |
T * | m_ptr |
TC::ScopedPtr mimics a built-in pointer except that it guarantees deletion of the object pointed to on destruction of the TC::ScopedPtr TC::ScopedPtr is a simple solution for simple needs; use TC::SharedPtr or std::auto_ptr if your needs are more complex.
Definition at line 65 of file TCScopedPtr.h.
typedef ScopedPtr<T> TC::ScopedPtr< T, DELETER >::ThisType [private] |
Definition at line 68 of file TCScopedPtr.h.
typedef T* ThisType::* TC::ScopedPtr< T, DELETER >::unspecified_bool_type |
Definition at line 86 of file TCScopedPtr.h.
TC::ScopedPtr< T, DELETER >::ScopedPtr | ( | ) | [inline] |
TC::ScopedPtr< T, DELETER >::ScopedPtr | ( | T * | ptr | ) | [inline, explicit] |
TC::ScopedPtr< T, DELETER >::ScopedPtr | ( | std::auto_ptr< T > | ptr | ) | [inline, explicit] |
Construct the object pointing to a specified std::auto_ptr.
Definition at line 76 of file TCScopedPtr.h.
TC::ScopedPtr< T, DELETER >::~ScopedPtr | ( | ) | [inline] |
Destructor deletes the pointer.
Definition at line 79 of file TCScopedPtr.h.
References TC::ScopedPtr< T, DELETER >::m_ptr.
const T* TC::ScopedPtr< T, DELETER >::operator-> | ( | ) | const [inline] |
User define conversion to the const Template pointer type.
Definition at line 82 of file TCScopedPtr.h.
References TC::ScopedPtr< T, DELETER >::m_ptr.
T* TC::ScopedPtr< T, DELETER >::operator-> | ( | ) | [inline] |
User define conversion to the Template pointer type.
Definition at line 84 of file TCScopedPtr.h.
References TC::ScopedPtr< T, DELETER >::m_ptr.
TC::ScopedPtr< T, DELETER >::operator unspecified_bool_type | ( | ) | const [inline] |
User define conversion for if like "if (pointer)".
Definition at line 88 of file TCScopedPtr.h.
References TC::ScopedPtr< T, DELETER >::m_ptr.
bool TC::ScopedPtr< T, DELETER >::operator! | ( | ) | const [inline] |
User define conversion for if like "if (!pointer)".
Definition at line 94 of file TCScopedPtr.h.
References TC::ScopedPtr< T, DELETER >::m_ptr.
T* TC::ScopedPtr< T, DELETER >::m_ptr [private] |
Definition at line 97 of file TCScopedPtr.h.
Referenced by TC::ScopedPtr< T, DELETER >::operator unspecified_bool_type(), TC::ScopedPtr< T, DELETER >::operator!(), TC::ScopedPtr< T, DELETER >::operator->(), and TC::ScopedPtr< T, DELETER >::~ScopedPtr().