CrystalSpace

Public API Reference

CS::Utility::ScopedDelete< T > Class Template Reference

Helper class to delete a pointer when exiting a scope. More...

#include <csutil/scopeddelete.h>

Inheritance diagram for CS::Utility::ScopedDelete< T >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

T & operator * () const
 Dereference underlying pointer.
 operator T * () const
 Cast to a pointer.
T * operator-> () const
 Dereference underlying pointer.
 ScopedDelete (T *ptr)
 Construct from given pointer.
 ~ScopedDelete ()
 Destruct. Deletes the given pointer!


Detailed Description

template<class T>
class CS::Utility::ScopedDelete< T >

Helper class to delete a pointer when exiting a scope.

T is the type pointed to.

Definition at line 37 of file scopeddelete.h.


Constructor & Destructor Documentation

template<class T>
CS::Utility::ScopedDelete< T >::ScopedDelete ( T *  ptr  )  [inline]

Construct from given pointer.

Definition at line 42 of file scopeddelete.h.

template<class T>
CS::Utility::ScopedDelete< T >::~ScopedDelete (  )  [inline]

Destruct. Deletes the given pointer!

Definition at line 44 of file scopeddelete.h.


Member Function Documentation

template<class T>
T& CS::Utility::ScopedDelete< T >::operator * (  )  const [inline]

Dereference underlying pointer.

Definition at line 55 of file scopeddelete.h.

template<class T>
CS::Utility::ScopedDelete< T >::operator T * (  )  const [inline]

Cast to a pointer.

Definition at line 51 of file scopeddelete.h.

template<class T>
T* CS::Utility::ScopedDelete< T >::operator-> (  )  const [inline]

Dereference underlying pointer.

Definition at line 47 of file scopeddelete.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space 1.2.1 by doxygen 1.5.3