#include <AutoDelete.h>
Public Member Functions | |
| AutoDelete (void) | |
| AutoDelete (T *pointer) | |
| AutoDelete (T *pointer, bool is_array) | |
| AutoDelete (AutoDelete &rhs) | |
| AutoDelete & | operator= (AutoDelete &rhs) |
| ~AutoDelete (void) | |
| const T * | get () const |
| const T * | operator-> () const |
| const T & | operator* () const |
| T * | get () |
| T * | operator-> () |
| T & | operator* () |
| void | reset (T *pointer) |
| void | reset (T *pointer, bool is_array) |
| void | destruct () |
| void | decontrol () |
| void | swap (AutoDelete< T > &rhs) |
An object wrapper that deletes the object(s) on destruction. It additionally holds a flag specifying whether the wrapper is responsible for the object(s) to delete. Only one wrapper should be responsible for the delete 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.
| cl7::memory::AutoDelete< T >::AutoDelete | ( | void | ) | [inline] |
Default constructor.
| cl7::memory::AutoDelete< T >::AutoDelete | ( | T * | pointer | ) | [inline, explicit] |
Explicit constructor.
| cl7::memory::AutoDelete< T >::AutoDelete | ( | T * | pointer, | |
| bool | is_array | |||
| ) | [inline] |
Explicit constructor.
| cl7::memory::AutoDelete< T >::AutoDelete | ( | AutoDelete< T > & | rhs | ) | [inline] |
Copy constructor.
| cl7::memory::AutoDelete< T >::~AutoDelete | ( | void | ) | [inline] |
Destructor.
| void cl7::memory::AutoDelete< T >::decontrol | ( | ) | [inline] |
Forces the wrapper to lose responsibility for the delete operation.
| void cl7::memory::AutoDelete< T >::destruct | ( | ) | [inline] |
Deletes the object(s) (if responsible).
| const T* cl7::memory::AutoDelete< T >::get | ( | ) | const [inline] |
Returns the pointer to the object(s).
| T* cl7::memory::AutoDelete< T >::get | ( | ) | [inline] |
Returns the pointer to the object(s).
| const T& cl7::memory::AutoDelete< T >::operator* | ( | ) | const [inline] |
Returns the (first) object.
| T& cl7::memory::AutoDelete< T >::operator* | ( | ) | [inline] |
Returns the (first) object.
| const T* cl7::memory::AutoDelete< T >::operator-> | ( | ) | const [inline] |
Returns the pointer to the object(s).
| T* cl7::memory::AutoDelete< T >::operator-> | ( | ) | [inline] |
Returns the pointer to the object(s).
| AutoDelete& cl7::memory::AutoDelete< T >::operator= | ( | AutoDelete< T > & | rhs | ) | [inline] |
Copy assignment operator.
| void cl7::memory::AutoDelete< T >::reset | ( | T * | pointer, | |
| bool | is_array | |||
| ) | [inline] |
Replaces the pointer by another one. The current object(s) will be deleted if the wrapper is responsible. The wrapper will be responsible for the newly set object(s). The flag specifying whether the pointer holds an array of objects is reset.
| void cl7::memory::AutoDelete< T >::reset | ( | T * | pointer | ) | [inline] |
Replaces the pointer by another one. The current object(s) will be deleted if the wrapper is responsible. The wrapper will be responsible for the newly set object(s). The flag specifying whether the pointer holds an array of objects remains unchanged.
| void cl7::memory::AutoDelete< T >::swap | ( | AutoDelete< T > & | rhs | ) | [inline] |
Swaps the contents of two wrappers.
1.7.1