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

An auto-pointer for arrays. More...

#include <AutoPtr.h>

Public Member Functions

 AutoArrayPtr ()
 Create emptry AutoArrayPtr.
 
 AutoArrayPtr (T *in)
 Assign pointer to AutoArrayPtr.
 
 AutoArrayPtr (AutoArrayPtr &rhs)
 Copying from other AutoArrayPtr causes rhs to release ownership.
 
 ~AutoArrayPtr ()
 Destructor deletes owned pointer.
 
AutoArrayPtroperator= (AutoArrayPtr &rhs)
 Copying from other AutoArrayPtr causes rhs to release ownership.
 
AutoArrayPtroperator= (T *p)
 Assign new pointer, delete the pointer currently held.
 
 operator bool () const
 
T * get () const
 
T & operator[] (size_t i) const
 Access one array element.
 
void assign (T *new_arr)
 Assign a new pointer, deleting existing one.
 
T * release ()
 Release ownership. More...
 

Detailed Description

template<class T>
class AutoArrayPtr< T >

An auto-pointer for arrays.

The data must be allocates with new[], and it will be released via delete [].

See Also
AutoPtr

Member Function Documentation

template<class T>
T* AutoArrayPtr< T >::get ( ) const
inline
Returns
Returns the current value.
template<class T>
AutoArrayPtr< T >::operator bool ( ) const
inline
Returns
Returns true if pointer is valid.
template<class T>
T* AutoArrayPtr< T >::release ( )
inline

Release ownership.

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

Returns
Returns the original value.

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