HoldFlag
objects are used to temporarily change the value of an object, restoring the original value when the HoldFlag
object is destructed.
More...
#include <HoldFlag.h>
Public Member Functions | |
HoldFlag (T &newFlag, const T &holdFlag) | |
Constructor setting a temporary value for the given object. | |
HoldFlag (T &newFlag, const T &holdFlag, const T &finalFlag) | |
Constructor setting the a temporary value for the given object. | |
~HoldFlag () | |
Destructor. | |
Private Member Functions | |
HoldFlag () | |
Default constructor is private and not implemented. | |
HoldFlag (const HoldFlag &) | |
Copy constructor is private and not implemented. | |
HoldFlag & | operator= (const HoldFlag &) |
Assignment is private and not implemented. | |
Private Attributes | |
T & | theFlag |
The object to be changed. | |
T | oldFlag |
The value which will be restored when this is destroyed. |
HoldFlag
objects are used to temporarily change the value of an object, restoring the original value when the HoldFlag
object is destructed.
Definition at line 23 of file HoldFlag.h.
ThePEG::HoldFlag< T >::HoldFlag | ( | T & | newFlag, | |
const T & | holdFlag | |||
) | [inline] |
Constructor setting a temporary value for the given object.
newFlag | the object which value is temporarily changed. | |
holdFlag | the temporary value for the newFlag object. |
Definition at line 32 of file HoldFlag.h.
References ThePEG::HoldFlag< T >::oldFlag, and ThePEG::HoldFlag< T >::theFlag.
ThePEG::HoldFlag< T >::HoldFlag | ( | T & | newFlag, | |
const T & | holdFlag, | |||
const T & | finalFlag | |||
) | [inline] |
Constructor setting the a temporary value for the given object.
newFlag | the object which value is temporarily changed. | |
holdFlag | the temporary value for the newFlag object. | |
finalFlag | the newFlag object will be given the value finalFlag when the HoldFlag object is destroyed. |
Definition at line 42 of file HoldFlag.h.
References ThePEG::HoldFlag< T >::oldFlag, and ThePEG::HoldFlag< T >::theFlag.
ThePEG::HoldFlag< T >::~HoldFlag | ( | ) | [inline] |
Destructor.
Restores the corresponding object to its original value.
Definition at line 53 of file HoldFlag.h.
References ThePEG::HoldFlag< T >::oldFlag, and ThePEG::HoldFlag< T >::theFlag.