#include <application.h>
|
| Application () |
|
virtual | ~Application () |
|
int | Exec (int argc, char **argv) |
| executes the program
|
|
virtual std::string | ProgramName ()=0 |
| program name
|
|
virtual std::string | VersionString () |
| version string of application
|
|
virtual void | HelpText (std::ostream &out)=0 |
| help text of application without version information
|
|
virtual void | Initialize ()=0 |
| Initialize application data.
|
|
virtual bool | EvaluateOptions ()=0 |
| Process command line options.
|
|
void | CheckRequired (const std::string &option_name, const std::string &error_msg="") |
| Check weather required option is set.
|
|
virtual void | Run ()=0 |
| Main body of application.
|
|
boost::program_options::options_description_easy_init | AddProgramOptions (const std::string &group="") |
| add option for command line
|
|
boost::program_options::variables_map & | OptionsMap () |
| get available program options & descriptions
|
|
boost::program_options::options_description & | OptionsDesc () |
|
boost::program_options::options_description & | VisibleOptions () |
| filters out the Hidden group from the options descriptions
|
|
void | StopExecution () |
| call StopExecution after EvaluateOptions
|
|
|
void | ParseCommandLine (int argc, char **argv) |
| get input parameters from file, location may be specified in command line
|
|
|
boost::program_options::options_description | op_desc_ |
| program options required by all applications
|
|
boost::program_options::variables_map | op_vm_ |
| Variable map containing all program options.
|
|
boost::program_options::options_description | visible_options_ |
| program options without the Hidden group
|
|
Definition at line 30 of file application.h.
◆ Application()
votca::tools::Application::Application |
( |
| ) |
|
◆ ~Application()
votca::tools::Application::~Application |
( |
| ) |
|
|
virtualdefault |
◆ AddProgramOptions()
boost::program_options::options_description_easy_init votca::tools::Application::AddProgramOptions |
( |
const std::string & | group = "" | ) |
|
add option for command line
- Parameters
-
- Returns
- easy_init of boost, see documentation
Adds an option to the available command line options. If no group is specified, it is added to the standard group (Allowed Options). If group is given, a sub group for this set of options will be created.
Definition at line 106 of file application.cc.
◆ CheckRequired()
void votca::tools::Application::CheckRequired |
( |
const std::string & | option_name, |
|
|
const std::string & | error_msg = "" ) |
Check weather required option is set.
- Parameters
-
option_name | name of the option |
error_msg | error message if option is missing |
CheckRequired is called from EvaluateOptions if a required options is set. If not, the list of possible options is shown and an exception with the error message given in error_msg is thrown
Definition at line 149 of file application.cc.
◆ EvaluateOptions()
virtual bool votca::tools::Application::EvaluateOptions |
( |
| ) |
|
|
pure virtual |
Process command line options.
- Returns
- true to continue, false to stop
EvaluateOptions is called by Run after parsing the command line. return true if everything is ok, false to stop and show help text.
Implemented in CG_IMC_solve, CGForceMatching, CGOrderParam, CsgBoltzmann, CsgDensityApp, CsgFluctuations, CsgMapApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, DLPTopolApp, GmxTopolApp, TrajForce, votca::csg::CsgApplication, votca::xtp::XtpApplication, VotcaProperty, and XtpMap.
◆ Exec()
int votca::tools::Application::Exec |
( |
int | argc, |
|
|
char ** | argv ) |
executes the program
- Parameters
-
argc | argc from main |
argv | argv from main |
- Returns
- return code
Definition at line 59 of file application.cc.
◆ HelpText()
virtual void votca::tools::Application::HelpText |
( |
std::ostream & | out | ) |
|
|
pure virtual |
help text of application without version information
- Parameters
-
Implemented in CG_IMC_solve, CGForceMatching, CGOrderParam, CsgBoltzmann, CsgDensityApp, CsgDumpApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgRadiiApp, CsgREupdate, CsgStatApp, CsgTestApp, DLPTopolApp, GmxTopolApp, OrientCorrApp, TrajForce, VotcaProperty, XtpMap, XtpParallel, XtpRun, and XtpTools.
◆ Initialize()
virtual void votca::tools::Application::Initialize |
( |
| ) |
|
|
pure virtual |
Initialize application data.
Initialize is called by run before parsing the command line. All necessary command line arguments can be added here
Implemented in CG_IMC_solve, CGForceMatching, CGOrderParam, CsgBoltzmann, CsgDensityApp, CsgDumpApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgRadiiApp, CsgREupdate, CsgStatApp, CsgTestApp, DLPTopolApp, GmxTopolApp, OrientCorrApp, TrajForce, votca::csg::CsgApplication, votca::xtp::XtpApplication, VotcaProperty, and XtpMap.
◆ OptionsDesc()
boost::program_options::options_description & votca::tools::Application::OptionsDesc |
( |
| ) |
|
|
inline |
◆ OptionsMap()
boost::program_options::variables_map & votca::tools::Application::OptionsMap |
( |
| ) |
|
|
inline |
get available program options & descriptions
- Returns
- variables_map (see boost documentation)
Definition at line 116 of file application.h.
◆ ParseCommandLine()
void votca::tools::Application::ParseCommandLine |
( |
int | argc, |
|
|
char ** | argv ) |
|
private |
get input parameters from file, location may be specified in command line
Definition at line 126 of file application.cc.
◆ ProgramName()
virtual std::string votca::tools::Application::ProgramName |
( |
| ) |
|
|
pure virtual |
program name
- Returns
- string with program name
overload this function to set the program name
Implemented in CG_IMC_solve, CGForceMatching, CGOrderParam, CsgBoltzmann, CsgDensityApp, CsgDumpApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgRadiiApp, CsgREupdate, CsgStatApp, CsgTestApp, DLPTopolApp, GmxTopolApp, OrientCorrApp, TrajForce, VotcaProperty, XtpMap, XtpParallel, XtpRun, and XtpTools.
◆ Run()
virtual void votca::tools::Application::Run |
( |
| ) |
|
|
pure virtual |
◆ ShowHelpText()
void votca::tools::Application::ShowHelpText |
( |
std::ostream & | out | ) |
|
|
protectedvirtual |
◆ StopExecution()
void votca::tools::Application::StopExecution |
( |
| ) |
|
|
inline |
call StopExecution after EvaluateOptions
This is useful if the program executes an operation in EvaluateOptions and then wants to stop execution successfully. Call StopExecution and return true in EvaluateOptions.
Definition at line 136 of file application.h.
◆ VersionString()
virtual std::string votca::tools::Application::VersionString |
( |
| ) |
|
|
inlinevirtual |
version string of application
- Returns
- version string
Definition at line 55 of file application.h.
◆ VisibleOptions()
boost::program_options::options_description & votca::tools::Application::VisibleOptions |
( |
| ) |
|
|
inline |
filters out the Hidden group from the options descriptions
- Returns
- Option descriptions without the "Hidden" group
Definition at line 125 of file application.h.
◆ continue_execution_
bool votca::tools::Application::continue_execution_ = true |
|
protected |
◆ op_desc_
boost::program_options::options_description votca::tools::Application::op_desc_ |
|
private |
program options required by all applications
Definition at line 147 of file application.h.
◆ op_groups_
std::map<std::string, boost::program_options::options_description> votca::tools::Application::op_groups_ |
|
protected |
◆ op_vm_
boost::program_options::variables_map votca::tools::Application::op_vm_ |
|
private |
Variable map containing all program options.
Definition at line 149 of file application.h.
◆ visible_options_
boost::program_options::options_description votca::tools::Application::visible_options_ |
|
private |
program options without the Hidden group
Definition at line 154 of file application.h.
The documentation for this class was generated from the following files: