rutz::scoped_ptr< T > Class Template Reference

A smart-pointer for unshared objects. More...

#include <rutz/scopedptr.h>

List of all members.

Public Member Functions

 scoped_ptr (T *p=0) throw ()
 Construct with pointer to given object (or null).
template<class TT >
 scoped_ptr (TT *p) throw ()
 Construct with pointer to given object of related type.
 ~scoped_ptr ()
 Destructor.
void reset (T *p=0)
 Reset with pointer to different object (or null).
T & operator* () const throw ()
 Dereference.
T * operator-> () const throw ()
 Dereference for member access.
T * get () const throw ()
 Get a pointer to the referred-to object.

Detailed Description

template<class T>
class rutz::scoped_ptr< T >

A smart-pointer for unshared objects.

scoped_ptr mimics a built-in pointer except that it guarantees deletion of the object pointed to, either on destruction of the scoped_ptr or via an explicit reset().

Definition at line 52 of file scopedptr.h.


Constructor & Destructor Documentation

template<class T>
rutz::scoped_ptr< T >::scoped_ptr ( T *  p = 0  )  throw () [inline, explicit]

Construct with pointer to given object (or null).

Definition at line 56 of file scopedptr.h.

template<class T>
template<class TT >
rutz::scoped_ptr< T >::scoped_ptr ( TT *  p  )  throw () [inline, explicit]

Construct with pointer to given object of related type.

Definition at line 62 of file scopedptr.h.

template<class T>
rutz::scoped_ptr< T >::~scoped_ptr (  )  [inline]

Destructor.

Definition at line 67 of file scopedptr.h.


Member Function Documentation

template<class T>
T* rutz::scoped_ptr< T >::get (  )  const throw () [inline]

Get a pointer to the referred-to object.

Definition at line 86 of file scopedptr.h.

Referenced by VideoFrame::deepCopyOf(), and VideoFrame::operator=().

template<class T>
T& rutz::scoped_ptr< T >::operator* (  )  const throw () [inline]

Dereference.

Definition at line 78 of file scopedptr.h.

template<class T>
T* rutz::scoped_ptr< T >::operator-> (  )  const throw () [inline]

Dereference for member access.

Definition at line 82 of file scopedptr.h.

template<class T>
void rutz::scoped_ptr< T >::reset ( T *  p = 0  )  [inline]

Reset with pointer to different object (or null).

Definition at line 71 of file scopedptr.h.

Referenced by VideoFrame::fromFile(), and VideoFrame::operator=().


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:31:20 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3