thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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>

Public Member Functions

 HoldFlag (T &newFlag, const T &holdFlag)
 Constructor setting a temporary value for the given object. More...
 
 HoldFlag (T &newFlag, const T &holdFlag, const T &finalFlag)
 Constructor setting the a temporary value for the given object. More...
 
 ~HoldFlag ()
 Destructor. More...
 

Private Member Functions

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

◆ HoldFlag() [1/2]

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

Constructor setting a temporary value for the given object.

Parameters
newFlagthe object which value is temporarily changed.
holdFlagthe temporary value for the newFlag object.

Definition at line 32 of file HoldFlag.h.

References ThePEG::HoldFlag< T >::oldFlag, and ThePEG::HoldFlag< T >::theFlag.

◆ HoldFlag() [2/2]

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
newFlagthe object which value is temporarily changed.
holdFlagthe temporary value for the newFlag object.
finalFlagthe 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.

◆ ~HoldFlag()

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: