solver  1.0
Functions
processing of program arguments

Functions related to the parsing of program arguments. More...

Functions

template<class T >
parsePositiveNumber (const string &number)
 
bool getArgument (int &i, int argc, char *argv[], const string &fullName, const string &shortName, string &writeArgument)
 It processes the arguments with one parameter. More...
 
bool processArg (int &i, int argc, char *argv[], const string &fullName, const string &shortName, bool *toWrite=nullptr)
 It processes the arguments without parameters. More...
 
bool processArg (int &i, int argc, char *argv[], const string &fullName, const string &shortName, string &toWrite)
 It processes the arguments with one string parameter. More...
 
template<class T >
bool processArg (int &i, int argc, char *argv[], const string &fullName, const string &shortName, T &toWrite, T minValue=1)
 It processes the arguments with one numerical parameter. More...
 
bool processCommandLineArguments (int argc, char *argv[])
 It parses the program arguments and sets the desired parameters for optimization. More...
 

Detailed Description

Functions related to the parsing of program arguments.

Various functions related to the processing of program arguments. Passed arguments are reflected in the setting of the program.

See also
Settings

Function Documentation

bool getArgument ( int &  i,
int  argc,
char *  argv[],
const string &  fullName,
const string &  shortName,
string &  writeArgument 
)

It processes the arguments with one parameter.

Parameters
[in,out]iA reference to the index pointing to the current argument to be processed. The index may be updated.
argcThe number of program arguments including the program name.
argvArguments of the program.
fullNameThe full name of the argument, e.g. "--use-heuristic-algorithm".
shortNameAbbreviated version of the full argument, e.g. "-uha".
[out]writeArgumentString to which the parameter of the argument is written, e.g. for "--max-runtime 10.5" the string contains "10.5".
Returns
Whether the argument with the given name (short or full) was processed.

Definition at line 154 of file ProjectSolver.cpp.

template<class T >
T parsePositiveNumber ( const string &  number)
Parameters
numberA string containing only a positive number.
Template Parameters
TEither unsigned integer or double.
Returns
A positive number parsed from the string.
Exceptions
InvalidArgumentString cannot be converted to a positive number.

Definition at line 131 of file ProjectSolver.cpp.

bool processArg ( int &  i,
int  argc,
char *  argv[],
const string &  fullName,
const string &  shortName,
bool *  toWrite = nullptr 
)

It processes the arguments without parameters.

Parameters
[in,out]iA reference to the index pointing to the current argument to be processed. The index may be updated.
argcThe number of program arguments including the program name.
argvArguments of the program.
fullNameThe full name of the argument, e.g. "--use-heuristic-algorithm".
shortNameAbbreviated version of the full argument, e.g. "-uha".
[out]toWriteA pointer to a boolean variable that is set to true if the argument, e.g. "--verbose", is passed to the program.
Returns
Whether the argument with the given name (short or full) was processed.

Definition at line 178 of file ProjectSolver.cpp.

bool processArg ( int &  i,
int  argc,
char *  argv[],
const string &  fullName,
const string &  shortName,
string &  toWrite 
)

It processes the arguments with one string parameter.

Parameters
[in,out]iA reference to the index pointing to the current argument to be processed. The index may be updated.
argcThe number of program arguments including the program name.
argvArguments of the program.
fullNameThe full name of the argument, e.g. "--use-heuristic-algorithm".
shortNameAbbreviated version of the full argument, e.g. "-uha".
[out]toWriteString to which the parameter of the given argument is written.
Returns
Whether the argument with the given name (short or full) was processed.

Definition at line 199 of file ProjectSolver.cpp.

template<class T >
bool processArg ( int &  i,
int  argc,
char *  argv[],
const string &  fullName,
const string &  shortName,
T &  toWrite,
minValue = 1 
)

It processes the arguments with one numerical parameter.

Parameters
[in,out]iA reference to the index pointing to the current argument to be processed. The index may be updated.
argcThe number of program arguments including the program name.
argvArguments of the program.
fullNameThe full name of the argument, e.g. "--use-heuristic-algorithm".
shortNameAbbreviated version of the full argument, e.g. "-uha".
Template Parameters
TEither positive integer or double.
Parameters
[out]toWriteA reference to a variable to which the parameter of the given argument is written.
minValueThe minimal allowed value of the parameter.
Returns
Whether the argument with the given name (short or full) was processed.

Definition at line 216 of file ProjectSolver.cpp.

bool processCommandLineArguments ( int  argc,
char *  argv[] 
)

It parses the program arguments and sets the desired parameters for optimization.

Parameters
argcThe number of program arguments (+parameters) passed to the program is argc-1.
argvProgram name and arguments (+parameters) of the program.
Returns
Returns true if the program should exit, otherwise false.

Definition at line 243 of file ProjectSolver.cpp.