torc-master
|
Template class that stores the current value of a variable and restores that value when this object goes out of scope. More...
#include <TemporaryAssignment.hpp>
Public Member Functions | |
TemporaryAssignment (TYPE &inVariable) | |
Public constructor that does not assign a new value. More... | |
TemporaryAssignment (TYPE &inVariable, TYPE inValue) | |
Public constructor that assigns a new value. More... | |
~TemporaryAssignment (void) | |
Public destructor to restore the original value. More... | |
Protected Attributes | |
TYPE & | mVariable |
Reference to the variable. More... | |
TYPE | mOriginalValue |
Original value of the variable. More... | |
Template class that stores the current value of a variable and restores that value when this object goes out of scope.
Definition at line 30 of file TemporaryAssignment.hpp.
|
inline |
Public constructor that does not assign a new value.
inVariable | The variable to save and restore. |
Definition at line 41 of file TemporaryAssignment.hpp.
|
inline |
Public constructor that assigns a new value.
inVariable | The variable to save and restore. |
inValue | The new value to use. |
Definition at line 47 of file TemporaryAssignment.hpp.
|
inline |
Public destructor to restore the original value.
Definition at line 52 of file TemporaryAssignment.hpp.
|
protected |
Original value of the variable.
Definition at line 36 of file TemporaryAssignment.hpp.
|
protected |
Reference to the variable.
Definition at line 34 of file TemporaryAssignment.hpp.