AUTO_DELETE< T > Class Template Reference

#include <basic_types.h>

List of all members.

Public Member Functions

 AUTO_DELETE (T *iniPtr=NULL)
T * operator= (T *newPtr)
 operator T * () const
T * operator-> () const
 ~AUTO_DELETE ()

Private Member Functions

void destroy ()
 AUTO_DELETE (const AUTO_DELETE &)
AUTO_DELETEoperator= (const AUTO_DELETE &)

Private Attributes

T * myPtr

Detailed Description

template<class T>
class AUTO_DELETE< T >

AUTO_DELETE: Self-deleting pointer (when going out of scope or changing values)

int function() { ... AUTO_DELETE<Class1> c1; if (cond1) { c1_ptr = < function that returns new Class1 > } ... c1_ptr = func2(); // previous c1_ptr deleted automatically ... if (cond2) { return 0; // c1_ptr data deleted automatically } ... }


Constructor & Destructor Documentation

template<class T >
AUTO_DELETE< T >::AUTO_DELETE ( T *  iniPtr = NULL  )  [inline]
template<class T >
AUTO_DELETE< T >::~AUTO_DELETE (  )  [inline]

References AUTO_DELETE< T >::destroy().

Here is the call graph for this function:

template<class T >
AUTO_DELETE< T >::AUTO_DELETE ( const AUTO_DELETE< T > &   )  [private]

Member Function Documentation

template<class T >
void AUTO_DELETE< T >::destroy (  )  [inline, private]
template<class T >
AUTO_DELETE< T >::operator T * (  )  const [inline]
template<class T >
T* AUTO_DELETE< T >::operator-> (  )  const [inline]
template<class T >
T* AUTO_DELETE< T >::operator= ( T *  newPtr  )  [inline]

References AUTO_DELETE< T >::destroy(), and AUTO_DELETE< T >::myPtr.

Here is the call graph for this function:

template<class T >
AUTO_DELETE& AUTO_DELETE< T >::operator= ( const AUTO_DELETE< T > &   )  [private]

Member Data Documentation


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