JDFTx  1.7.0
Command Class Referenceabstract

Abstract base class for all commands. More...

#include <command.h>

Inheritance diagram for Command:
CommandMinimize

Public Member Functions

virtual void process (ParamList &pl, Everything &e)=0
 Process the command from its command line. More...
 
virtual void printStatus (Everything &e, int iRep)=0
 Print a command line that would result in the current status. More...
 

Public Attributes

string name
 Identifier for the command in the input file. Must be unique!
 
string format
 Usage syntax for the command (excluding the command name)
 
string comments
 Detailed help for the command which goes into jdftx -t as well as the Doxygen manual. Please check formatting in both versions.
 
string section
 Which executable the command belongs to, and hence which section it must be documented under.
 
string category
 Category of command under which to list the documentation.
 
string subcategory
 Subcategory of command under which to list the documentation.
 
std::set< stringrequires
 Names of other commands that this one requires; those commands will be processed before this one.
 
std::set< stringforbids
 Names of other commands that this one is incompatibile with.
 
bool allowMultiple
 Whether this command can occur multiple times in an input file (default: false).
 
bool hasDefault
 Whether this command has a default (default: false). If true, process() will be called with an empty parameter list.
 
string emptyParamError
 Error message if command is manually issued with no parameters. Default: empty i.e. allow empty parameter list.
 

Protected Member Functions

 Command (string name, string path)
 
void require (string)
 utility to add a command to the requires list
 
void forbid (string)
 utility to add a command to the forbids list
 

Detailed Description

Abstract base class for all commands.

Constructor & Destructor Documentation

◆ Command()

Command::Command ( string  name,
string  path 
)
protected

This base class constructor adds the current command to a map from names to Command pointers which can be accessed using getCommandMap(). This enables safe static initialization of the command list.

Parameters
nameUnique name of the command
pathDocumentation path for the command in the format "section/category/subcategory", where section is the name of the executable (jdftx, phonon or wannier), and the remaining help organize commands in the doc

Member Function Documentation

◆ printStatus()

virtual void Command::printStatus ( Everything e,
int  iRep 
)
pure virtual

Print a command line that would result in the current status.

Parameters
eObject of class Everything whose status to reproduce
iRepFor commands with allowMultiple=true, printStatus will be called multiple times and iRep is the index of the present call

Implemented in CommandMinimize.

◆ process()

virtual void Command::process ( ParamList pl,
Everything e 
)
pure virtual

Process the command from its command line.

Parameters
plParser utility object that simplifies extraction of parameters from the commandline
eObject of class Everything into which the settings extracted form this command should be stored
Exceptions
stringOn any syntax / parse errors, throw a string containing a brief error (preferably single phrase) error message.

Implemented in CommandMinimize.


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