#include <AutoRelease.h>
Public Member Functions | |
| AutoRelease (void) | |
| AutoRelease (T *object) | |
| AutoRelease (AutoRelease &rhs) | |
| AutoRelease & | operator= (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) |
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.
| xl7::memory::AutoRelease< T >::AutoRelease | ( | void | ) | [inline] |
Default constructor.
| xl7::memory::AutoRelease< T >::AutoRelease | ( | T * | object | ) | [inline, explicit] |
Explicit constructor.
| xl7::memory::AutoRelease< T >::AutoRelease | ( | AutoRelease< T > & | rhs | ) | [inline] |
Copy constructor.
| xl7::memory::AutoRelease< T >::~AutoRelease | ( | void | ) | [inline] |
Destructor.
| void xl7::memory::AutoRelease< T >::decontrol | ( | ) | [inline] |
Forces the wrapper to lose responsibility for the release operation.
| void xl7::memory::AutoRelease< T >::destruct | ( | ) | [inline] |
Releases the object (if responsible).
| T* xl7::memory::AutoRelease< T >::get | ( | ) | [inline] |
Returns the pointer to the object.
| const T* xl7::memory::AutoRelease< T >::get | ( | ) | const [inline] |
Returns the pointer to the object.
| T& xl7::memory::AutoRelease< T >::operator* | ( | ) | [inline] |
Returns the object.
| const T& xl7::memory::AutoRelease< T >::operator* | ( | ) | const [inline] |
Returns the object.
| T* xl7::memory::AutoRelease< T >::operator-> | ( | ) | [inline] |
Returns the pointer to the object.
| const T* xl7::memory::AutoRelease< T >::operator-> | ( | ) | const [inline] |
Returns the pointer to the object.
| AutoRelease& xl7::memory::AutoRelease< T >::operator= | ( | AutoRelease< T > & | rhs | ) | [inline] |
Copy assignment operator.
| 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.
| void xl7::memory::AutoRelease< T >::swap | ( | AutoRelease< T > & | rhs | ) | [inline] |
Swaps the contents of two wrappers.
1.6.1