A wrapper class to provide AutoPtr with reference semantics.
AutoPtrArray handles memory management of an array of objects.
AutoPtrArray & operator=(AutoPtrArray< T > &a_)
Assignment from another AutoPtrArray of a different but related type.
X * m_ptr
Pointer to the object we own.
AutoPtrArray & operator=(AutoPtrArray &a_)
Assignment operator deletes memory it owns and transfers the ownership from a_ to itself.
AutoPtrArray(X *p_=0)
Construct an AutoPtrArray from a raw pointer.
AutoPtrArray & operator=(AutoPtrArrayRef< X > ref_)
AutoPtrArray(AutoPtrArray< T > &a_)
Construct AutoPtrArray from another AutoPtrArray of different (but related) type.
~AutoPtrArray()
When AutoPtrArray goes out of scope, the object it owns is deleted.
X * operator->() const
Smart pointer dereferencing.
AutoPtrArray(AutoPtrArray &a_)
Construct AutoPtrArray from another AutoPtrArray.
void reset(X *p_=0)
Forcibly delete the managed object and assume the ownership of a_.
X * release()
Give up the ownership of the memory.
X * get() const
Get a raw memory pointer without changing ownership status.
X & operator[](int i) const
Access operator.
X & operator*() const
Smart pointer dereferencing.
AutoPtrArray(AutoPtrArrayRef< X > ref_)
Automagic conversions.
A wrapper class to provide AutoPtr with reference semantics.
AutoPtr is based on SGI implementation of a auto_ptr template that makes memory handling a little bit...
void reset(X *p_=0)
Forcibly delete the managed object and assume the ownership of a_.
AutoPtr(X *p_=0)
Construct an AutoPtr from a raw pointer.
X & operator*() const
Smart pointer dereferencing.
X * release()
Give up the ownership of the memory.
AutoPtr(AutoPtr< T > &a_)
Construct AutoPtr from another AutoPtr of different (but related) type.
X * get() const
Get a raw memory pointer without changing ownership status.
AutoPtr(AutoPtrRef< X > ref_)
Automagic conversions.
AutoPtr & operator=(AutoPtr &a_)
Assignment operator deletes memory it owns and transfers the ownership from a_ to itself.
X * m_ptr
Pointer to the object we own.
~AutoPtr()
When AutoPtr goes out of scope, the object it owns is deleted.
AutoPtr(AutoPtr &a_)
Construct AutoPtr from another AutoPtr.
AutoPtr & operator=(AutoPtr< T > &a_)
Assignment from another AutoPtr of a different but related type.
X * operator->() const
Smart pointer dereferencing.
AutoPtr & operator=(AutoPtrRef< X > ref_)