thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::HoldFlag< bool > Class Reference

Specialization of HoldFlag for boolean variables. More...

#include <HoldFlag.h>

Public Member Functions

 HoldFlag (bool &newFlag, bool holdFlag=true)
 Constructor setting the a temporary value for the bool variable.
 
 HoldFlag (bool &newFlag, bool holdFlag, bool finalFlag)
 Constructor setting the a temporary value for the bool variable.
 
 ~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 &)=delete
 Assignment is private and not implemented.
 

Private Attributes

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

Detailed Description

Specialization of HoldFlag for boolean variables.

Definition at line 88 of file HoldFlag.h.

Constructor & Destructor Documentation

◆ HoldFlag() [1/2]

ThePEG::HoldFlag< bool >::HoldFlag ( bool &  newFlag,
bool  holdFlag = true 
)
inline

Constructor setting the a temporary value for the bool variable.

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

Definition at line 97 of file HoldFlag.h.

References ThePEG::HoldFlag< T >::theFlag.

◆ HoldFlag() [2/2]

ThePEG::HoldFlag< bool >::HoldFlag ( bool &  newFlag,
bool  holdFlag,
bool  finalFlag 
)
inline

Constructor setting the a temporary value for the bool variable.

Parameters
newFlagthe boolean variable which value is temporarily changed.
holdFlagthe temporary value for the newFlag variable.
finalFlagthe newFlag variable will be given the value finalFlag when the HoldFlag object is destroyed.

Definition at line 107 of file HoldFlag.h.

References ThePEG::HoldFlag< T >::theFlag.

◆ ~HoldFlag()

ThePEG::HoldFlag< bool >::~HoldFlag ( )
inline

Destructor.

Restores the corresponding variable to its original value.

Definition at line 114 of file HoldFlag.h.

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

Member Data Documentation

◆ oldFlag

bool ThePEG::HoldFlag< bool >::oldFlag
private

The value which will be restored when this is destroyed.

Definition at line 126 of file HoldFlag.h.

◆ theFlag

bool& ThePEG::HoldFlag< bool >::theFlag
private

The variable to be changed.

Definition at line 121 of file HoldFlag.h.


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