xl7::memory::AutoRelease< T > Class Template Reference

#include <AutoRelease.h>

List of all members.

Public Member Functions

 AutoRelease (void)
 AutoRelease (T *object)
 AutoRelease (AutoRelease &rhs)
AutoReleaseoperator= (AutoRelease &rhs)
 ~AutoRelease (void)
const T * get () const
const T * operator-> () const
const T & operator* () const
T * get ()
T * operator-> ()
T & operator* ()
void reset (T *object)
void destruct ()
void decontrol ()
void swap (AutoRelease< T > &rhs)

Detailed Description

template<typename T>
class xl7::memory::AutoRelease< T >

An object wrapper that releases the object on destruction. It additionally holds a flag specifying whether the wrapper is responsible for the object to release. Only one wrapper should be responsible for the release operation. If a wrapper is created through the copy constructor or the copy assignment operator, the new wrapper becomes responsible (if the source wrapper was responsible at all). This class works very similar to std::auto_ptr.


Constructor & Destructor Documentation

template<typename T>
xl7::memory::AutoRelease< T >::AutoRelease ( void   )  [inline]

Default constructor.

template<typename T>
xl7::memory::AutoRelease< T >::AutoRelease ( T *  object  )  [inline, explicit]

Explicit constructor.

template<typename T>
xl7::memory::AutoRelease< T >::AutoRelease ( AutoRelease< T > &  rhs  )  [inline]

Copy constructor.

template<typename T>
xl7::memory::AutoRelease< T >::~AutoRelease ( void   )  [inline]

Destructor.


Member Function Documentation

template<typename T>
void xl7::memory::AutoRelease< T >::decontrol (  )  [inline]

Forces the wrapper to lose responsibility for the release operation.

template<typename T>
void xl7::memory::AutoRelease< T >::destruct (  )  [inline]

Releases the object (if responsible).

template<typename T>
T* xl7::memory::AutoRelease< T >::get (  )  [inline]

Returns the pointer to the object.

template<typename T>
const T* xl7::memory::AutoRelease< T >::get (  )  const [inline]

Returns the pointer to the object.

template<typename T>
T& xl7::memory::AutoRelease< T >::operator* (  )  [inline]

Returns the object.

template<typename T>
const T& xl7::memory::AutoRelease< T >::operator* (  )  const [inline]

Returns the object.

template<typename T>
T* xl7::memory::AutoRelease< T >::operator-> (  )  [inline]

Returns the pointer to the object.

template<typename T>
const T* xl7::memory::AutoRelease< T >::operator-> (  )  const [inline]

Returns the pointer to the object.

template<typename T>
AutoRelease& xl7::memory::AutoRelease< T >::operator= ( AutoRelease< T > &  rhs  )  [inline]

Copy assignment operator.

template<typename T>
void xl7::memory::AutoRelease< T >::reset ( T *  object  )  [inline]

Replaces the object by another one. The current object will be released if the wrapper is responsible. The wrapper will be responsible for the newly set object.

template<typename T>
void xl7::memory::AutoRelease< T >::swap ( AutoRelease< T > &  rhs  )  [inline]

Swaps the contents of two wrappers.


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

Generated on Tue Dec 1 13:21:19 2009 for flange77: Cyber E-Razor rockt die Galaxis by  doxygen 1.6.1