File: HoldFlag.h
Description:
HoldFlag object are used to temporarily change the value
of a variable, restoring the original value when the
HoldFlag object is destructed.
namespace Pythia7
template <typename T = bool>
CLASS
HoldFlag
Public members:
inline HoldFlag(T & newFlag, const T & holdFlag);
Ctor setting the newFlag to holdFlag.
inline HoldFlag(T & newFlag, const T & holdFlag, const T & finalFlag);
Ctor setting the newFlag to holdFlag. newFlag will get the value
finalFlag when the object is destroyed.
inline ~HoldFlag();
Dtor restoring the variable to its original value.
Private members:
T & theFlag;
The variable.
T oldFlag;
The value which will be restored when this is destroyed.
inline HoldFlag();
inline HoldFlag(const HoldFlag &);
inline HoldFlag & operator=(const HoldFlag &);
Default ctors and assignment are private and not implemented.
template <>
CLASS
HoldFlag<bool>
Public members:
inline HoldFlag(bool & newFlag, bool holdFlag = true);
inline HoldFlag(bool & newFlag, bool holdFlag, bool finalFlag);
inline ~HoldFlag();
Private members:
bool & theFlag;
bool oldFlag;
inline HoldFlag();
inline HoldFlag(const HoldFlag &);
inline HoldFlag & operator=(const HoldFlag &);
DEFINED MACROS
INCLUDED FILES