VERB4D
|
Holds the parameters along with their corresponding file and arguments. More...
#include <Parameters.h>
Public Member Functions | |
Parameters (string filename, int argc=1, char *argv[]=NULL) | |
~Parameters () | |
Destructor - tells this parameter to close its file. | |
void | close () |
close parameter file | |
Parameters & | findParameter (string parameterName, string defaultValue="") |
Find the parameters given and return them as a parameter struct. More... | |
template<typename T > | |
void | getParameter (string parameterName, T &variable, bool mustBeFound=false) |
get the parameter value and store it into variable More... | |
Holds the parameters along with their corresponding file and arguments.
Parameters::Parameters | ( | string | filename, |
int | argc = 1 , |
||
char * | argv[] = NULL |
||
) |
Constructor for Parameters: opens file and saves file to Parameters field 'parametersFile', stores the char* arguments into a vector 'argv'
Parameters & Parameters::findParameter | ( | string | parameterName, |
string | defaultValue = "" |
||
) |
Find the parameters given and return them as a parameter struct.
Finds the parameters with parameterName in parametersFile and saves it to argv
parameterName | - name of parameter |
template void Parameters::getParameter | ( | string | parameterName, |
T & | variable, | ||
bool | mustBeFound = false |
||
) |
get the parameter value and store it into variable
Gets the value for a parameters with parameterName and saves it into variable
parameterName | - name of parameter |
variable | - variable for storing parameter |
mustBeFound | - if true and parameter not found, error is logged and function exited, default is false |