#include <AutoRestore.h>
Public Member Functions | |
| AutoRestore (void) | |
| AutoRestore (T *object) | |
| AutoRestore (const AutoRestore &rhs) | |
| AutoRestore & | operator= (AutoRestore &rhs) |
| ~AutoRestore (void) | |
| const T * | get () const |
| const T & | get_copy () const |
| const T * | operator-> () const |
| const T & | operator* () const |
| T * | get () |
| T * | operator-> () |
| T & | operator* () |
| void | reset (T *object) |
| void | restore () |
| void | decontrol () |
| void | swap (AutoRestore< T > &rhs) |
An object wrapper that restores the initial state of an object on destruction. It additionally holds a flag specifying whether the wrapper is responsible for the object to restore. Multiple wrappers may be responsible for a restore operation. If a wrapper is created through the copy constructor or the copy assignment operator, the new wrapper becomes responsible as well (if the source wrapper was responsible at all).
| cl7::utilities::AutoRestore< T >::AutoRestore | ( | void | ) | [inline] |
Default constructor.
| cl7::utilities::AutoRestore< T >::AutoRestore | ( | T * | object | ) | [inline, explicit] |
Explicit constructor.
| cl7::utilities::AutoRestore< T >::AutoRestore | ( | const AutoRestore< T > & | rhs | ) | [inline] |
Copy constructor.
| cl7::utilities::AutoRestore< T >::~AutoRestore | ( | void | ) | [inline] |
Destructor.
| void cl7::utilities::AutoRestore< T >::decontrol | ( | ) | [inline] |
Forces the wrapper to lose responsibility for the release operation.
| const T* cl7::utilities::AutoRestore< T >::get | ( | ) | const [inline] |
Returns the pointer to the object.
| T* cl7::utilities::AutoRestore< T >::get | ( | ) | [inline] |
Returns the pointer to the object.
| const T& cl7::utilities::AutoRestore< T >::get_copy | ( | ) | const [inline] |
Returns the copy of the object.
| T& cl7::utilities::AutoRestore< T >::operator* | ( | ) | [inline] |
Returns the object.
| const T& cl7::utilities::AutoRestore< T >::operator* | ( | ) | const [inline] |
Returns the object.
| T* cl7::utilities::AutoRestore< T >::operator-> | ( | ) | [inline] |
Returns the pointer to the object.
| const T* cl7::utilities::AutoRestore< T >::operator-> | ( | ) | const [inline] |
Returns the pointer to the object.
| AutoRestore& cl7::utilities::AutoRestore< T >::operator= | ( | AutoRestore< T > & | rhs | ) | [inline] |
Copy assignment operator.
| void cl7::utilities::AutoRestore< T >::reset | ( | T * | object | ) | [inline] |
Replaces the object by another one. The current object will be restored if the wrapper is responsible. The wrapper will be responsible for the newly set object.
| void cl7::utilities::AutoRestore< T >::restore | ( | ) | [inline] |
Restores the object (if responsible).
| void cl7::utilities::AutoRestore< T >::swap | ( | AutoRestore< T > & | rhs | ) | [inline] |
Swaps the contents of two wrappers.
1.7.1