cxcparamx
1.1.0
|
#include <cxcparamx/simple.h>
Public Member Functions | |
simple (int argc, char **argv, const char *mode="rw") | |
Constructor with file name taken from argv[0]. More... | |
simple (const char *filename, int argc, char **argv, const char *mode="rw") | |
Constructor with explicit parameter file name. More... | |
simple (const std::string &filename, int argc, char **argv, const char *mode="rw") | |
Constructor with explicit parameter file name. More... | |
void | get (const char *name, float &value) |
Retrieve a parameter value into a float. More... | |
void | get (const char *name, double &value) |
Retrieve a parameter value into a double. More... | |
void | get (const char *name, short &value) |
Retrieve a parameter value into a short. More... | |
void | get (const char *name, int &value) |
Retrieve a parameter value into an int. More... | |
void | get (const char *name, long &value) |
Retrieve a parameter value into a long. More... | |
void | get (const char *name, bool &value) |
Retrieve a parameter value into an bool. More... | |
void | get (const char *name, std::string &value) |
Retrieve a parameter value into an string. More... | |
float | getf (const char *name) |
Return a parameter value as a float. More... | |
double | getd (const char *name) |
Return a parameter value as a double. More... | |
short | gets (const char *name) |
Return a parameter value as a short. More... | |
int | geti (const char *name) |
Return a parameter value as an int. More... | |
long | getl (const char *name) |
Return a parameter value as a long. More... | |
bool | getb (const char *name) |
Return a parameter value as an bool. More... | |
std::string | getstr (const char *name) |
Return a parameter value as an string. More... | |
A simple wrapper class providing polymorphic attribute retrieval.
Instantiating the class opens the parameter file; the file is closed during object destruction.
cxcparamx::simple::simple | ( | int | argc, |
char ** | argv, | ||
const char * | mode = "rw" |
||
) |
Constructor with file name taken from argv[0].
[in] | argc | the number of elements in argv |
[in] | argv | typically, the command line arguments vector passed to main* |
[in] | mode | mode with which to open the file |
cxcparamx::simple::simple | ( | const char * | filename, |
int | argc, | ||
char ** | argv, | ||
const char * | mode = "rw" |
||
) |
Constructor with explicit parameter file name.
[in] | filename | the parameter file name |
[in] | argc | the number of elements in argv |
argv | typically, the command line arguments vector passed to main | |
[in] | mode | mode with which to open the file |
cxcparamx::simple::simple | ( | const std::string & | filename, |
int | argc, | ||
char ** | argv, | ||
const char * | mode = "rw" |
||
) |
Constructor with explicit parameter file name.
[in] | filename | the parameter file name |
[in] | argc | the number of elements in argv |
argv | typically, the command line arguments vector passed to main | |
[in] | mode | mode with which to open the file |
void cxcparamx::simple::get | ( | const char * | name, |
float & | value | ||
) |
Retrieve a parameter value into a float.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
void cxcparamx::simple::get | ( | const char * | name, |
double & | value | ||
) |
Retrieve a parameter value into a double.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
void cxcparamx::simple::get | ( | const char * | name, |
short & | value | ||
) |
Retrieve a parameter value into a short.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
void cxcparamx::simple::get | ( | const char * | name, |
int & | value | ||
) |
Retrieve a parameter value into an int.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
void cxcparamx::simple::get | ( | const char * | name, |
long & | value | ||
) |
Retrieve a parameter value into a long.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
void cxcparamx::simple::get | ( | const char * | name, |
bool & | value | ||
) |
Retrieve a parameter value into an bool.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
void cxcparamx::simple::get | ( | const char * | name, |
std::string & | value | ||
) |
Retrieve a parameter value into an string.
[in] | name | parameter name |
[out] | value | returned value |
Exception | if parameter is not found |
bool cxcparamx::simple::getb | ( | const char * | name) |
Return a parameter value as an bool.
[in] | name | parameter name |
Exception | if parameter is not found |
double cxcparamx::simple::getd | ( | const char * | name) |
Return a parameter value as a double.
[in] | name | parameter name |
Exception | if parameter is not found |
float cxcparamx::simple::getf | ( | const char * | name) |
Return a parameter value as a float.
[in] | name | parameter name |
Exception | if parameter is not found |
int cxcparamx::simple::geti | ( | const char * | name) |
Return a parameter value as an int.
[in] | name | parameter name |
Exception | if parameter is not found |
long cxcparamx::simple::getl | ( | const char * | name) |
Return a parameter value as a long.
[in] | name | parameter name |
Exception | if parameter is not found |
short cxcparamx::simple::gets | ( | const char * | name) |
Return a parameter value as a short.
[in] | name | parameter name |
Exception | if parameter is not found |
string cxcparamx::simple::getstr | ( | const char * | name) |
Return a parameter value as an string.
[in] | name | parameter name |
Exception | if parameter is not found |