|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
#include <LUPI.hpp>
Public Member Functions | |
| ArgumentParser (std::string const &a_codeName, std::string const &a_descriptor="") | |
| ~ArgumentParser () | |
| std::string const & | codeName () const |
| std::string const & | descriptor () const |
| template<typename T> | |
| T * | add (std::string const &a_name, std::string const &a_descriptor, int a_minimumNeeded=1, int a_maximumNeeded=1) |
| ArgumentBase * | add (ArgumentType a_argumentType, std::string const &a_name, std::string const &a_descriptor, int a_minimumNeeded=-2, int a_maximumNeeded=-2) |
| void | addAlias (std::string const &a_name, std::string const &a_alias) |
| void | addAlias (ArgumentBase const *const a_argumentBase, std::string const &a_alias) |
| bool | hasName (std::string const &a_name) const |
| bool | isOptionalArgument (std::string const &a_name) const |
| void | parse (int a_argc, char **a_argv, bool a_printArguments=true) |
| template<typename T> | |
| T * | get (std::size_t a_name) |
| void | help () const |
| void | usage () const |
| virtual void | printStatus (std::string a_indent) const |
| LUPI::ArgumentParser::ArgumentParser | ( | std::string const & | a_codeName, |
| std::string const & | a_descriptor = "" ) |
ArgumentParser constructor.
Definition at line 455 of file LUPI_argumentParser.cc.
| LUPI::ArgumentParser::~ArgumentParser | ( | ) |
ArgumentParser destructor.
Definition at line 465 of file LUPI_argumentParser.cc.
| ArgumentBase * LUPI::ArgumentParser::add | ( | ArgumentType | a_argumentType, |
| std::string const & | a_name, | ||
| std::string const & | a_descriptor, | ||
| int | a_minimumNeeded = -2, | ||
| int | a_maximumNeeded = -2 ) |
Creates an argument instance of type specified by a_argumentType and adds to this.
| a_argumentType | [in] The type of argument to create. |
| a_name | [in] The name of the argument. |
| a_descriptor | [in] The string printed with arugment's help. |
| a_minimumNeeded | [in] The minimum number of times the argument must be entered. |
| a_maximumNeeded | [in] The maximum number of times the argument can be entered. |
Definition at line 508 of file LUPI_argumentParser.cc.
| T * LUPI::ArgumentParser::add | ( | std::string const & | a_name, |
| std::string const & | a_descriptor, | ||
| int | a_minimumNeeded = 1, | ||
| int | a_maximumNeeded = 1 ) |
Creates a new argument, adds the argument to this and returns a pointer the the newly created argument.
| a_name | [in] The name of the argument. |
| a_descriptor | [in] The argument's description, displayed when the help option is enetered. |
| a_minimumNeeded | [in] The minimum number of required time this argument must be entered. |
| a_maximumNeeded | [in] The maximum number of required time this argument must be entered. |
Definition at line 172 of file LUPI.hpp.
| void LUPI::ArgumentParser::addAlias | ( | ArgumentBase const *const | a_argumentBase, |
| std::string const & | a_alias ) |
Adds the alias a_alias to the argument a_argumentBase.
| a_argumentBase | [in] The argument to add the alias to. |
| a_alias | [in] The name of the argument to add the alias to. |
Definition at line 566 of file LUPI_argumentParser.cc.
| void LUPI::ArgumentParser::addAlias | ( | std::string const & | a_name, |
| std::string const & | a_alias ) |
Adds the alias a_alias to the argument named a_name.
| a_name | [in] The name of the argument to add the alias to. |
| a_alias | [in] The alias name to add. |
Definition at line 545 of file LUPI_argumentParser.cc.
Referenced by addAlias().
|
inline |
|
inline |
| T * LUPI::ArgumentParser::get | ( | std::size_t | a_name | ) |
| bool LUPI::ArgumentParser::hasName | ( | std::string const & | a_name | ) | const |
Returns true if name a_name is in this and false otherwise.
| a_name | [in] The name to see check if it exists in this. |
Definition at line 596 of file LUPI_argumentParser.cc.
Referenced by addAlias().
| void LUPI::ArgumentParser::help | ( | ) | const |
Prints the help for this.
Definition at line 672 of file LUPI_argumentParser.cc.
Referenced by parse().
| bool LUPI::ArgumentParser::isOptionalArgument | ( | std::string const & | a_name | ) | const |
Returns true if name a_name is an optional argument of this and false otherwise.
| a_name | [in] The name to see check if it exists in this. |
Definition at line 579 of file LUPI_argumentParser.cc.
Referenced by LUPI::ArgumentBase::parse().
| void LUPI::ArgumentParser::parse | ( | int | a_argc, |
| char ** | a_argv, | ||
| bool | a_printArguments = true ) |
Parses the list of arguments.
| a_argc | [in] The number of arguments. |
| a_argv | [in] The list of arguments. |
Definition at line 612 of file LUPI_argumentParser.cc.
|
virtual |
Returns the usage string for this option.
| a_indent | [in] The amount of indentation to start the first line with. |
Definition at line 763 of file LUPI_argumentParser.cc.
| void LUPI::ArgumentParser::usage | ( | ) | const |
Prints the usage for this.
Definition at line 720 of file LUPI_argumentParser.cc.
Referenced by help().