votca 2024.2-dev
Loading...
Searching...
No Matches
votca::xtp::XtpApplication Class Referenceabstract

#include <xtpapplication.h>

Inheritance diagram for votca::xtp::XtpApplication:
Collaboration diagram for votca::xtp::XtpApplication:

Public Member Functions

 XtpApplication ()
 
 ~XtpApplication () override
 
void Initialize () final
 Adds program options to the executable.
 
bool EvaluateOptions () final
 Process command line options.
 
void Run () final
 Main body of application.
 
void ShowHelpText (std::ostream &out) final
 
- Public Member Functions inherited from votca::tools::Application
 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
 
void CheckRequired (const std::string &option_name, const std::string &error_msg="")
 Check weather required option is set.
 
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
 

Protected Member Functions

virtual void execute ()=0
 
virtual std::string CalculatorType () const =0
 
virtual void EvaluateSpecificOptions ()=0
 
virtual std::vector< std::string > CalculatorNames () const =0
 
virtual void CreateCalculator (const std::string &name)=0
 
virtual void AddCommandLineOptions ()=0
 
- Protected Member Functions inherited from votca::tools::Application

Protected Attributes

votca::tools::Property options_
 
- Protected Attributes inherited from votca::tools::Application
std::map< std::string, boost::program_options::options_description > op_groups_
 
bool continue_execution_ = true
 

Private Member Functions

void PrintShortHelp (std::ostream &out, const std::string &calculator_name) const
 
void PrintLongHelp (std::ostream &out, const std::string &calculator_name, tools::PropertyIOManipulator::Type format) const
 
bool CalcExists (const std::string &name) const
 

Detailed Description

Definition at line 34 of file xtpapplication.h.

Constructor & Destructor Documentation

◆ XtpApplication()

votca::xtp::XtpApplication::XtpApplication ( )
default

◆ ~XtpApplication()

votca::xtp::XtpApplication::~XtpApplication ( )
overridedefault

Member Function Documentation

◆ AddCommandLineOptions()

virtual void votca::xtp::XtpApplication::AddCommandLineOptions ( )
protectedpure virtual

Implemented in votca::xtp::StateApplication, and XtpTools.

◆ CalcExists()

bool votca::xtp::XtpApplication::CalcExists ( const std::string & name) const
inlineprivate

Definition at line 65 of file xtpapplication.h.

◆ CalculatorNames()

virtual std::vector< std::string > votca::xtp::XtpApplication::CalculatorNames ( ) const
protectedpure virtual

Implemented in XtpParallel, XtpRun, and XtpTools.

◆ CalculatorType()

virtual std::string votca::xtp::XtpApplication::CalculatorType ( ) const
protectedpure virtual

Implemented in XtpParallel, XtpRun, and XtpTools.

◆ CreateCalculator()

virtual void votca::xtp::XtpApplication::CreateCalculator ( const std::string & name)
protectedpure virtual

Implemented in XtpParallel, XtpRun, and XtpTools.

◆ EvaluateOptions()

bool votca::xtp::XtpApplication::EvaluateOptions ( )
finalvirtual

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.

Implements votca::tools::Application.

Definition at line 88 of file xtpapplication.cc.

◆ EvaluateSpecificOptions()

virtual void votca::xtp::XtpApplication::EvaluateSpecificOptions ( )
protectedpure virtual

Implemented in votca::xtp::StateApplication, and XtpTools.

◆ execute()

virtual void votca::xtp::XtpApplication::execute ( )
protectedpure virtual

Implemented in votca::xtp::StateApplication, and XtpTools.

◆ Initialize()

void votca::xtp::XtpApplication::Initialize ( void )
finalvirtual

Adds program options to the executable.

Every executable requires option file for calculators it is running It is thus a part of the base XtpApplication class

Implements votca::tools::Application.

Definition at line 51 of file xtpapplication.cc.

◆ PrintLongHelp()

void votca::xtp::XtpApplication::PrintLongHelp ( std::ostream & out,
const std::string & calculator_name,
tools::PropertyIOManipulator::Type format ) const
private

Definition at line 221 of file xtpapplication.cc.

◆ PrintShortHelp()

void votca::xtp::XtpApplication::PrintShortHelp ( std::ostream & out,
const std::string & calculator_name ) const
private

Definition at line 208 of file xtpapplication.cc.

◆ Run()

void votca::xtp::XtpApplication::Run ( )
finalvirtual

Main body of application.

Run is called after command line was parsed + evaluated. All the work should be done in here.

Implements votca::tools::Application.

Definition at line 187 of file xtpapplication.cc.

◆ ShowHelpText()

void votca::xtp::XtpApplication::ShowHelpText ( std::ostream & out)
finalvirtual

Reimplemented from votca::tools::Application.

Definition at line 198 of file xtpapplication.cc.

Member Data Documentation

◆ options_

votca::tools::Property votca::xtp::XtpApplication::options_
protected

Definition at line 56 of file xtpapplication.h.


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