|
NTrace
GPU ray tracing framework
|
#include <Environment.h>
Inherited by AppEnvironment.
Public Member Functions | |||||||||
PrintUsage | |||||||||
Prints out all environment variable names
| |||||||||
| virtual void | PrintUsage (ostream &s) const | ||||||||
SetStaticOptions | |||||||||
Gets global option values
| |||||||||
| virtual void | SetStaticOptions () | ||||||||
RegisterOption | |||||||||
Method for registering new option. Using this method is possible to register new option with it's name, type, abbreviation and default value.
| |||||||||
| void | RegisterOption (const char *name, const OptionType type, const char *abbrev, const char *defValue=NULL) | ||||||||
SetInt | |||||||||
Method for setting new Int.
| |||||||||
| void | SetInt (const char *name, const int value) | ||||||||
SetFloat | |||||||||
Method for setting new Float.
| |||||||||
| void | SetFloat (const char *name, const float value) | ||||||||
SetBool | |||||||||
Method for setting new Bool.
| |||||||||
| void | SetBool (const char *name, const bool value) | ||||||||
SetString | |||||||||
Method for setting new String.
| |||||||||
| void | SetString (const char *name, const char *value) | ||||||||
GetBool | |||||||||
Method for getting Bool
| |||||||||
| bool | GetBool (const char *name, const bool isFatal=false) const | ||||||||
GetInt | |||||||||
Method for getting Int
| |||||||||
| int | GetInt (const char *name, const bool isFatal=false) const | ||||||||
GetFloat | |||||||||
Method for getting Float
| |||||||||
| float | GetFloat (const char *name, const bool isFatal=false) const | ||||||||
GetDouble | |||||||||
Method for getting Double
| |||||||||
| double | GetDouble (const char *name, const bool isFatal=false) const | ||||||||
GetIntValue | |||||||||
Get Integer value
| |||||||||
| bool | GetIntValue (const char *name, int &value, const bool isFatal=false) const | ||||||||
GetDoubleValue | |||||||||
Get Double value
| |||||||||
| bool | GetDoubleValue (const char *name, double &value, const bool isFatal=false) const | ||||||||
GetFloatValue | |||||||||
Get Float value
| |||||||||
| bool | GetFloatValue (const char *name, float &value, const bool isFatal=false) const | ||||||||
GetBoolValue | |||||||||
Get Bool value
| |||||||||
| bool | GetBoolValue (const char *name, bool &value, const bool isFatal=false) const | ||||||||
GetStringValue | |||||||||
Get String value
| |||||||||
| bool | GetStringValue (const char *name, char *value, const bool isFatal=false) const | ||||||||
| bool | GetStringValue (const char *name, string &value, const bool isFatal=false) const | ||||||||
CheckForSwitch | |||||||||
Check if the specified switch is present in the command line. Primary use of this function is to check for presence of some special switch, e.g. -h for help. It can be used anytime.
| |||||||||
| bool | CheckForSwitch (const int argc, char **argv, const char swtch) const | ||||||||
ReadCmdlineParams | |||||||||
First pass of parsing command line. This function parses command line and gets from there all non-optional parameters (i.e. not prefixed by the dash) and builds a table of parameters. According to param optParams, it also writes some optional parameters to this table and pair them with corresponding non-optional parameters.
| |||||||||
| void | ReadCmdlineParams (const int argc, char **argv, const char *optParams) | ||||||||
ReadEnvFile | |||||||||
Reading of the environment file. This function reads the environment file.
| |||||||||
| bool | ReadEnvFile (const char *filename) | ||||||||
| void | ParseCmdline (const int argc, char **argv, const int index) | ||||||||
| int | GetParamNum () const | ||||||||
| bool | GetParam (const char name, const int index, char *value) const | ||||||||
Environment | |||||||||
| Environment () | |||||||||
| virtual | ~Environment () | ||||||||
Static Public Member Functions | |||
SetSingleton | |||
Sets singleton pointer to one passed by argument
| |||
| static Environment * | GetSingleton () | ||
GetSingleton | |||
Gets singleton pointer, if NULL - then exit
| |||
| static void | SetSingleton (Environment *e) | ||
DeleteSingleton | |||
Deletes singleton pointer
| |||
| static void | DeleteSingleton () | ||
OptionPresent | |
Determine whether option is present. const char* - Specifies name of option
| |
| static Environment * | mEnvironment = NULL |
| bool | OptionPresent (const char *name) const |
Definition at line 160 of file Environment.h.
| Environment::Environment | ( | ) |
Definition at line 1128 of file Environment.cpp.
|
virtual |
Definition at line 1157 of file Environment.cpp.
| bool Environment::CheckForSwitch | ( | const int | argc, |
| char ** | argv, | ||
| const char | swtch | ||
| ) | const |
Definition at line 641 of file Environment.cpp.
|
static |
Definition at line 220 of file Environment.cpp.
| bool Environment::GetBool | ( | const char * | name, |
| const bool | isFatal = false |
||
| ) | const |
Definition at line 431 of file Environment.cpp.
| bool Environment::GetBoolValue | ( | const char * | name, |
| bool & | value, | ||
| const bool | isFatal = false |
||
| ) | const |
Definition at line 579 of file Environment.cpp.
| double Environment::GetDouble | ( | const char * | name, |
| const bool | isFatal = false |
||
| ) | const |
Definition at line 482 of file Environment.cpp.
| bool Environment::GetDoubleValue | ( | const char * | name, |
| double & | value, | ||
| const bool | isFatal = false |
||
| ) | const |
Definition at line 527 of file Environment.cpp.
| float Environment::GetFloat | ( | const char * | name, |
| const bool | isFatal = false |
||
| ) | const |
Definition at line 464 of file Environment.cpp.
| bool Environment::GetFloatValue | ( | const char * | name, |
| float & | value, | ||
| const bool | isFatal = false |
||
| ) | const |
Definition at line 553 of file Environment.cpp.
| int Environment::GetInt | ( | const char * | name, |
| const bool | isFatal = false |
||
| ) | const |
Definition at line 446 of file Environment.cpp.
| bool Environment::GetIntValue | ( | const char * | name, |
| int & | value, | ||
| const bool | isFatal = false |
||
| ) | const |
Definition at line 501 of file Environment.cpp.
| bool Environment::GetParam | ( | const char | name, |
| const int | index, | ||
| char * | value | ||
| ) | const |
Returns the indexed parameter or corresponding optional parameter. This function is used for queries on individual non-optional parameters. The table must be constructed to allow this function to operate (i.e. the first pass of command line parsing must be done).
| name | If space (' '), returns the non-optional parameter, else returns the corresponding optional parameter. |
| index | Index of the non-optional parameter to which all other options corresponds. |
| value | Return value of the queried parameter. |
Definition at line 1064 of file Environment.cpp.
|
inline |
Parameters number query function. This function returns number of non-optional parameters specified on the command line.
Definition at line 436 of file Environment.h.
|
static |
Definition at line 203 of file Environment.cpp.
| bool Environment::GetStringValue | ( | const char * | name, |
| char * | value, | ||
| const bool | isFatal = false |
||
| ) | const |
Definition at line 601 of file Environment.cpp.
| bool Environment::GetStringValue | ( | const char * | name, |
| string & | value, | ||
| const bool | isFatal = false |
||
| ) | const |
Definition at line 623 of file Environment.cpp.
| bool Environment::OptionPresent | ( | const char * | name | ) | const |
Definition at line 1096 of file Environment.cpp.
| void Environment::ParseCmdline | ( | const int | argc, |
| char ** | argv, | ||
| const int | index | ||
| ) |
Second pass of the command line parsing. Performs parsing of the command line ignoring all parameters and options read in the first pass. Builds table of options.
| argc | Number of command line arguments. |
| argv | Array of command line arguments. |
| index | Index of non-optional parameter, of which options should be read in. |
Definition at line 951 of file Environment.cpp.
|
virtual |
Definition at line 232 of file Environment.cpp.
| void Environment::ReadCmdlineParams | ( | const int | argc, |
| char ** | argv, | ||
| const char * | optParams | ||
| ) |
Definition at line 662 of file Environment.cpp.
| bool Environment::ReadEnvFile | ( | const char * | filename | ) |
Definition at line 743 of file Environment.cpp.
| void Environment::RegisterOption | ( | const char * | name, |
| const OptionType | type, | ||
| const char * | abbrev, | ||
| const char * | defValue = NULL |
||
| ) |
Definition at line 264 of file Environment.cpp.
| void Environment::SetBool | ( | const char * | name, |
| const bool | value | ||
| ) |
Definition at line 375 of file Environment.cpp.
| void Environment::SetFloat | ( | const char * | name, |
| const float | value | ||
| ) |
Definition at line 349 of file Environment.cpp.
| void Environment::SetInt | ( | const char * | name, |
| const int | value | ||
| ) |
Definition at line 323 of file Environment.cpp.
|
static |
Definition at line 192 of file Environment.cpp.
|
virtual |
Definition at line 246 of file Environment.cpp.
| void Environment::SetString | ( | const char * | name, |
| const char * | value | ||
| ) |
Definition at line 406 of file Environment.cpp.
|
static |
Definition at line 459 of file Environment.h.