EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
AutoPtr< T > Class Template Reference

Holds pointer, deletes in destructor. More...

#include <AutoPtr.h>

Public Member Functions

 AutoPtr (T *in)
 Assign pointer to AutoPtr.
 
 AutoPtr (AutoPtr &rhs)
 Copying from other AutoPtr causes rhs to release ownership.
 
 ~AutoPtr ()
 Destructor deletes owned pointer.
 
AutoPtroperator= (AutoPtr &rhs)
 Copying from other AutoPtr causes rhs to release ownership.
 
AutoPtroperator= (T *p)
 Assignment operator.
 
 operator bool () const
 Casting operator.
 
T & operator* () const
 Allow access just like ordinary pointer.
 
T * operator-> () const
 Allow access just like ordinary pointer.
 
T * get () const
 Get the pointer.
 
 operator T * () const
 Allow access just like ordinary pointer.
 
void assign (T *new_ptr)
 Assign a new pointer, deleting existing one.
 
T * release ()
 Release ownership. More...
 

Detailed Description

template<class T>
class AutoPtr< T >

Holds pointer, deletes in destructor.

This AutoPtr is meant for holding a pointer to one instance of something. The instance is removed via delete.

For arrays that need to be removed via delete[], see AutoArrayPtr.

See Also
AutoArrayPtr

Member Function Documentation

template<class T>
T* AutoPtr< T >::release ( )
inline

Release ownership.

The AutoPtr is set to 0, and the pointer that used to be handled by the AutoPtr is returned.

Returns
Returns the original value.

The documentation for this class was generated from the following file: