thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::SwitchOption Class Reference

SwitchOption is used by the Switch class and its base class SwitchBase to define valid options in a switch. More...

#include <Switch.h>

Inheritance diagram for ThePEG::SwitchOption:

Public Member Functions

template<typename EnumT >
 SwitchOption (SwitchBase &theSwitch, string newName, string newDescription, EnumT newValue)
 Standard constructor.
 
 SwitchOption ()
 Default constructor.
 
const string & description () const
 The description of this option.
 
long value () const
 The value of this option.
 
 operator long () const
 The value of this option.
 
- Public Member Functions inherited from ThePEG::Named
 Named (const string &newName=string())
 Constructor with name.
 
 Named (const Named &)=default
 Explicit default copy-constructor (too avoid compiler warnings)
 
const string & name () const
 Return name.
 
bool operator== (const Named &other) const
 Test for equality.
 
bool operator< (const Named &other) const
 Lexicographical comparison.
 

Private Attributes

string theDescription
 The description of this option.
 
long theValue
 The value of this option.
 

Additional Inherited Members

- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 

Detailed Description

SwitchOption is used by the Switch class and its base class SwitchBase to define valid options in a switch.

For each InterfacedBase class exactly one static Switch object should created for each member variable which should be interfaced. This object will automatically register itself with the BaseRepository class. Also for each Switch object exactly one static SwitchOption object should be created for each valid integer option.

See also
InterfacedBase
InterfacedBase
Named

Definition at line 36 of file Switch.h.

Constructor & Destructor Documentation

◆ SwitchOption() [1/2]

template<typename EnumT >
ThePEG::SwitchOption::SwitchOption ( SwitchBase theSwitch,
string  newName,
string  newDescription,
EnumT  newValue 
)

Standard constructor.

Parameters
theSwitchthe Switch object for which this option is defined. Note thet the static Switch object must be created before this is created.
newNamethe name of the option, may only contain letters [a-zA-z0-9_].
newDescriptiona brief description of the option.
newValuethe integer value corresponding to this option.

◆ SwitchOption() [2/2]

ThePEG::SwitchOption::SwitchOption ( )
inline

Default constructor.

Definition at line 61 of file Switch.h.

Member Function Documentation

◆ description()

const string & ThePEG::SwitchOption::description ( ) const
inline

The description of this option.

Definition at line 66 of file Switch.h.

References theDescription.

◆ value()

long ThePEG::SwitchOption::value ( ) const
inline

The value of this option.

Definition at line 71 of file Switch.h.

References theValue.

Referenced by ThePEG::SwitchBase::registerOption().

Member Data Documentation

◆ theDescription

string ThePEG::SwitchOption::theDescription
private

The description of this option.

Definition at line 85 of file Switch.h.

Referenced by description().

◆ theValue

long ThePEG::SwitchOption::theValue
private

The value of this option.

Definition at line 90 of file Switch.h.

Referenced by value().


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