ThePEG::HoldFlag< T > Class Template Reference

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>

List of all members.

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.
HoldFlagoperator= (const HoldFlag &)
 Assignment is private and not implemented.

Private Attributes

T & theFlag
 The object to be changed.
oldFlag
 The value which will be restored when this is destroyed.


Detailed Description

template<typename T = bool>
class ThePEG::HoldFlag< T >

HoldFlag objects are used to temporarily change the value of an object, restoring the original value when the HoldFlag object is destructed.

See also:
Level

Definition at line 23 of file HoldFlag.h.


Constructor & Destructor Documentation

template<typename T = bool>
ThePEG::HoldFlag< T >::HoldFlag ( T &  newFlag,
const T &  holdFlag 
) [inline]

Constructor setting a temporary value for the given object.

Parameters:
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.

template<typename T = bool>
ThePEG::HoldFlag< T >::HoldFlag ( T &  newFlag,
const T &  holdFlag,
const T &  finalFlag 
) [inline]

Constructor setting the a temporary value for the given object.

Parameters:
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.

template<typename T = bool>
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.


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

Generated on Thu Apr 29 12:43:25 2010 for ThePEG by  doxygen 1.5.5