OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <CmdArguments.h>
Public Member Functions | |
CmdArguments (int argc, char **argv) | |
CmdArguments () | |
~CmdArguments () | |
template<class T > | |
T | getArg (const std::string name, bool isFatal=false) |
template<class T > | |
T | getArg (const std::string name, T default_value, bool isFatal=false) |
template<class T > | |
void | addArgument (const std::string &name, const T &value) |
template<class T > | |
void | replaceArgument (const std::string &name, const T &value) |
char ** | getArguments () const |
unsigned int | getNumArguments () const |
Private Member Functions | |
void | addArguments (int argc, char **argv) |
parse user arguments More... | |
void | split (std::string &name, std::string &value, std::string arg) |
helper to split string More... | |
template<class T > | |
T | arg (const std::string name) |
Private Attributes | |
std::map< std::string, std::string > | arguments_ |
container for storing command line options More... | |
std::set< std::string > | warned_ |
Definition at line 42 of file CmdArguments.h.
|
inline |
Definition at line 46 of file CmdArguments.h.
References addArguments().
|
inline |
Definition at line 50 of file CmdArguments.h.
|
inline |
Definition at line 53 of file CmdArguments.h.
|
inline |
Definition at line 107 of file CmdArguments.h.
References arguments_, and name.
|
private |
parse user arguments
Definition at line 32 of file CmdArguments.cpp.
References arg(), arguments_, name, and split().
Referenced by CmdArguments().
|
inlineprivate |
tries to retrieve command line parameter.
OptPilotException | if parameter was not found. |
Definition at line 179 of file CmdArguments.h.
References arguments_, name, and Attrib::Legacy::Distribution::T.
Referenced by addArguments(), and split().
|
inline |
Get command line argument without specifying default value.
Definition at line 60 of file CmdArguments.h.
References name.
|
inline |
Get command line argument with default value. If the parameter is not found either an exception is thrown or a warning is written to stdout and the default value is used (
[in] | name | of the command line argument |
[in] | default_value | of the parameter |
[in] | isFatal | throw exception if parameter is expected to be present, default is false |
Definition at line 76 of file CmdArguments.h.
References Physics::e, endl(), name, Attrib::Legacy::Distribution::T, Options::warn, and warned_.
char ** CmdArguments::getArguments | ( | ) | const |
Definition at line 54 of file CmdArguments.cpp.
References arguments_, and end().
|
inline |
Definition at line 133 of file CmdArguments.h.
References arguments_.
|
inline |
Definition at line 120 of file CmdArguments.h.
References arguments_, and name.
|
private |
helper to split string
Definition at line 42 of file CmdArguments.cpp.
Referenced by addArguments().
|
private |
container for storing command line options
Definition at line 159 of file CmdArguments.h.
Referenced by addArgument(), addArguments(), arg(), getArguments(), getNumArguments(), and replaceArgument().
|
private |
Definition at line 161 of file CmdArguments.h.
Referenced by getArg().