A SgRestorer<T> variable saves the current state of a variable of type T and restores it to that saved value upon leaving the scope in an exception-safe way. More...
#include <SgRestorer.h>
Public Member Functions | |
SgRestorer (T *oldState) | |
~SgRestorer () | |
Private Member Functions | |
SgRestorer (const SgRestorer &) | |
Not implemented. | |
SgRestorer & | operator= (const SgRestorer &) |
Not implemented. | |
Private Attributes | |
T * | m_variable |
T | m_oldState |
A SgRestorer<T> variable saves the current state of a variable of type T and restores it to that saved value upon leaving the scope in an exception-safe way.
Definition at line 15 of file SgRestorer.h.
SgRestorer< T >::SgRestorer | ( | T * | oldState | ) | [explicit] |
Definition at line 18 of file SgRestorer.h.
SgRestorer< T >::~SgRestorer | ( | ) |
Definition at line 23 of file SgRestorer.h.
References SgRestorer< T >::m_oldState, and SgRestorer< T >::m_variable.
SgRestorer< T >::SgRestorer | ( | const SgRestorer< T > & | ) | [private] |
Not implemented.
SgRestorer& SgRestorer< T >::operator= | ( | const SgRestorer< T > & | ) | [private] |
Not implemented.
T SgRestorer< T >::m_oldState [private] |
Definition at line 31 of file SgRestorer.h.
Referenced by SgRestorer< T >::~SgRestorer().
T* SgRestorer< T >::m_variable [private] |
Definition at line 29 of file SgRestorer.h.
Referenced by SgRestorer< T >::~SgRestorer().