VERB4D
Public Member Functions | List of all members
Parameters Class Reference

Holds the parameters along with their corresponding file and arguments. More...

#include <Parameters.h>

Inheritance diagram for Parameters:

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
 
ParametersfindParameter (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...
 

Detailed Description

Holds the parameters along with their corresponding file and arguments.

Constructor & Destructor Documentation

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'

Member Function Documentation

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

Parameters
parameterName- name of parameter
template<typename T >
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

Parameters
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

The documentation for this class was generated from the following files: