PROFASI  Version 1.5
Public Member Functions | List of all members
prf_utils::ProgSwitch Class Reference

A program switch. More...

#include <ProgUtils.hh>

Inheritance diagram for prf_utils::ProgSwitch:
Inheritance graph
[legend]

Public Member Functions

 ProgSwitch (std::string longname, std::string shortname, bool defstate, std::string somedesc="")
 Constructor with long and short names, default state and short help.
 
bool on () const
 Query if the switch is on.
 
bool off () const
 Query if the switch is off.
 
void turn_on ()
 Turn the switch on.
 
void turn_off ()
 Turn the switch off.
 
- Public Member Functions inherited from prf_utils::OptBase
void Name (std::string st)
 Set a name for an option created with the default constructor.
 
std::string Name () const
 Retrieve the option name.
 
std::string LongName () const
 Retrieve long name.
 
void LongName (std::string st)
 Set a long name.
 
std::string short_help () const
 Retrieve short help-text/info.
 
void short_help (std::string st)
 Set short help text.
 
std::string help () const
 Help text.
 
void set_help_text (std::string st)
 Set help text.
 
void append_help_text (std::string st)
 Append to existing help text.
 
void set_given ()
 Activate the option.
 
bool state () const
 Is the option active ?
 

Detailed Description

It's a boolean parameter altering the program behaviour. If it is declared as a ProgSwitch, instead of a plain bool variable, it can be used in connection with ProgArgs and will be automatically interfaced through settings files and the command line. A program switch can be given on the command line in positive or negative form. For instance, a flag called "green" makes something happen. It can be given on the command line as "&ndash;green". The explicit negation of the flag can be given as "&ndash;no-green". In a settings file, these two take the form "green on " and "green off".


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

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2