AutoPtr
Engine/source/core/util/autoPtr.h
A simple smart pointer.
Public Types
ValueType
Public Functions
AutoPtr(AutoPtrRef< T > ref)
~AutoPtr()
bool
isNull()
bool
isValid()
T *
AutoPtr &
AutoPtr &
operator=(AutoPtrRef< T > ref)
T &
operator[](size_t index)
Detailed Description
A simple smart pointer.
An extended version of std::auto_ptr which supports a deletion policy. The delete policy indicates how the ptr is to be deleted. DeleteSingle, the default, is used to delete individual objects. DeleteArray can can be used to delete arrays.
AutoPtrAutoPtrs do not perform reference counting and assume total ownership of any object assigned to them. Assigning an AutoPtr to another transfers that ownership and resets the source AutoPtr to 0.
Public Types
typedef T ValueType
Private Attributes
T * _ptr
Public Functions
AutoPtr(AutoPtr & rhs)
AutoPtr(AutoPtr< U, P > & rhs)
AutoPtr(AutoPtrRef< T > ref)
AutoPtr(T * ptr)
~AutoPtr()
isNull()
isValid()
operator AutoPtr< U, P>()
operator AutoPtrRef< U>()
operator*()
operator->()
operator=(AutoPtr & rhs)
Transfer ownership, any object currently be referenced is deleted and rhs is set to 0.
operator=(AutoPtr< U, P > & rhs)
operator=(AutoPtrRef< T > ref)
operator[](size_t index)
ptr()
release()
Release ownership of the object without deleting it.
reset(T * ptr)
Equivalent to this = (T)ptr, except that operator=(T*) isn't provided for.