Abstract base class for all commands. More...
#include <command.h>
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< string > | requires |
Names of other commands that this one requires; those commands will be processed before this one. | |
std::set< string > | forbids |
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 | |
Abstract base class for all commands.
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.
name | Unique name of the command |
path | Documentation 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 |
|
pure virtual |
Print a command line that would result in the current status.
e | Object of class Everything whose status to reproduce |
iRep | For commands with allowMultiple=true, printStatus will be called multiple times and iRep is the index of the present call |
Implemented in CommandMinimize.
|
pure virtual |
Process the command from its command line.
pl | Parser utility object that simplifies extraction of parameters from the commandline |
e | Object of class Everything into which the settings extracted form this command should be stored |
string | On any syntax / parse errors, throw a string containing a brief error (preferably single phrase) error message. |
Implemented in CommandMinimize.