Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes

SgRestorer< T > Class Template Reference

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>

List of all members.

Public Member Functions

 SgRestorer (T *oldState)
 ~SgRestorer ()

Private Member Functions

 SgRestorer (const SgRestorer &)
 Not implemented.
SgRestoreroperator= (const SgRestorer &)
 Not implemented.

Private Attributes

T * m_variable
m_oldState

Detailed Description

template<class T>
class SgRestorer< T >

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.


Constructor & Destructor Documentation

template<class T >
SgRestorer< T >::SgRestorer ( T *  oldState  )  [explicit]

Definition at line 18 of file SgRestorer.h.

template<class T >
SgRestorer< T >::~SgRestorer (  ) 

Definition at line 23 of file SgRestorer.h.

References SgRestorer< T >::m_oldState, and SgRestorer< T >::m_variable.

template<class T >
SgRestorer< T >::SgRestorer ( const SgRestorer< T > &   )  [private]

Not implemented.


Member Function Documentation

template<class T >
SgRestorer& SgRestorer< T >::operator= ( const SgRestorer< T > &   )  [private]

Not implemented.


Member Data Documentation

template<class T >
T SgRestorer< T >::m_oldState [private]

Definition at line 31 of file SgRestorer.h.

Referenced by SgRestorer< T >::~SgRestorer().

template<class T >
T* SgRestorer< T >::m_variable [private]

Definition at line 29 of file SgRestorer.h.

Referenced by SgRestorer< T >::~SgRestorer().


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


Sun Mar 13 2011 Doxygen 1.7.1