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 &)=delete |
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.
|
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, std::swap(), and ThePEG::HoldFlag< T >::theFlag.
|
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, std::swap(), and ThePEG::HoldFlag< T >::theFlag.
|
inline |
Destructor.
Restores the corresponding object to its original value.
Definition at line 53 of file HoldFlag.h.
References ThePEG::HoldFlag< T >::oldFlag, std::swap(), and ThePEG::HoldFlag< T >::theFlag.
|
private |
The value which will be restored when this is destroyed.
Definition at line 65 of file HoldFlag.h.
Referenced by ThePEG::HoldFlag< T >::HoldFlag(), ThePEG::HoldFlag< T >::~HoldFlag(), and ThePEG::HoldFlag< bool >::~HoldFlag().
|
private |
The object to be changed.
Definition at line 60 of file HoldFlag.h.
Referenced by ThePEG::HoldFlag< bool >::HoldFlag(), ThePEG::HoldFlag< T >::HoldFlag(), ThePEG::HoldFlag< T >::~HoldFlag(), and ThePEG::HoldFlag< bool >::~HoldFlag().