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

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.

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