ThePEG 2.3.0
|
SwitchOption is used by the Switch class and its base class SwitchBase to define valid options in a switch. More...
#include <Switch.h>
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 Named & | operator= (const Named &other) |
Assignment. | |
const string & | name (const string &newName) |
Set new name. | |
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.
ThePEG::SwitchOption::SwitchOption | ( | SwitchBase & | theSwitch, |
string | newName, | ||
string | newDescription, | ||
EnumT | newValue | ||
) |
Standard constructor.
theSwitch | the Switch object for which this option is defined. Note thet the static Switch object must be created before this is created. |
newName | the name of the option, may only contain letters [a-zA-z0-9_]. |
newDescription | a brief description of the option. |
newValue | the integer value corresponding to this option. |
|
inline |
|
inline |
|
inline |
The value of this option.
Definition at line 71 of file Switch.h.
References theValue.
Referenced by ThePEG::SwitchBase::registerOption().
|
private |
The description of this option.
Definition at line 85 of file Switch.h.
Referenced by description().
|
private |