In file /home/blah/darwin2k/src/ddcore/misc/paramParser.h:

class paramEnv

Environment containing parameter values.

Inheritance:


Public Methods

[more]virtual int getInt(const char* varName, int &val, int quiet = 0) = 0
Gets the value of an integer variable in the current context.
[more]virtual int getFloat(const char* varName, float &val, int quiet = 0) = 0
Gets the value of a float variable in the current context.
[more]virtual int getDouble(const char* varName, double &val, int quiet = 0) = 0
Gets the value of an double variable in the current context.
[more]virtual int getChar(const char* varName, char &val, int quiet = 0) = 0
Gets the value of an char variable in the current context.
[more]virtual int getString(const char* varName, const char* &val, int quiet = 0) = 0
Gets the value of a string variable in the current context.
[more]virtual int getEnum(const char* varName, int &val, int quiet = 0) = 0
Gets the value of an enum variable in the current context.
[more]virtual int getTriple(const char* varName, triple &val, int quiet = 0) = 0
Gets the value of a triple variable in the current context.
[more]virtual int getQuaternion(const char* varName, quaternion &val, int quiet = 0) = 0
Gets the value of a quaternion variable in the current context.
[more]virtual int pushContext(const char* context, int quiet = 0) = 0
pushes the current context and sets the context to the given value.
[more]virtual int popContext(void) = 0
pops the top context off the context stack and sets the current context to it.

Public Members

[more] Wrappers for paramEnv::get*() methods


Documentation

Environment containing parameter values. The environment is separated into a list of "contexts" which may be selected by "push"ing and "pop"ing operations.
ovirtual int getInt(const char* varName, int &val, int quiet = 0) = 0
Gets the value of an integer variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int getFloat(const char* varName, float &val, int quiet = 0) = 0
Gets the value of a float variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int getDouble(const char* varName, double &val, int quiet = 0) = 0
Gets the value of an double variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int getChar(const char* varName, char &val, int quiet = 0) = 0
Gets the value of an char variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int getString(const char* varName, const char* &val, int quiet = 0) = 0
Gets the value of a string variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0. NOTE: the user should either use the value the pointer before the next call to paramEnv::get*, or copy the string to other storage for later use. If there was no string with the given name, then a message will be printed (if quiet is non-zero), and the function returns 0.

ovirtual int getEnum(const char* varName, int &val, int quiet = 0) = 0
Gets the value of an enum variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int getTriple(const char* varName, triple &val, int quiet = 0) = 0
Gets the value of a triple variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int getQuaternion(const char* varName, quaternion &val, int quiet = 0) = 0
Gets the value of a quaternion variable in the current context. Returns 1 if such a value is found. If not then a message will be printed if quiet is non-zero, and the function returns 0.

ovirtual int pushContext(const char* context, int quiet = 0) = 0
pushes the current context and sets the context to the given value. Subsequent calls to one of the get* methods will only look up symbols in the supplied context and the global context.
Returns:
s Returns 1 if the specified context was found, 0 if not.

ovirtual int popContext(void) = 0
pops the top context off the context stack and sets the current context to it. Returns 1 if there was a context on the stack, or 0 if not.

o Wrappers for paramEnv::get*() methods
When a variable has the same name in the source file as in the environment, these macros can simplify reading their values from the parser. The GET_*() macros will print error messages if their variables are not specified in the environment, while QGET_*() is quiet and prints no messages. An example of using these macros:

int setMyVariables(paramEnv *paramvals) { int myInt; quaternion myQuaternion; double myOptionalDouble; int retval = 1;

read the required variables retval &= paramvals->GET_INT(myInt); retval &= paramvals->GET_INT(myQuaternion);

read the optional variable; don't complain if we can't read it paramvals->QGET_DOUBLE(myOptionalDouble);

if (!retval) { logError("parseMyVariables"); logPrintf(" problems reading variables\n"); } return retval; }

o#define GET_INT(var)
wrapper for paramEnv::getInt

o#define GET_FLOAT(var)
wrapper for paramEnv::getFloat

o#define GET_DOUBLE(var)
wrapper for paramEnv::getDouble

o#define GET_CHAR(var)
wrapper for paramEnv::getChar

o#define GET_STRING(var)
wrapper for paramEnv::getString

o#define GET_ENUM(var)
wrapper for paramEnv::getEnum

o#define GET_TRIPLE(var)
wrapper for paramEnv::getTriple

o#define GET_QUATERNION(var)
wrapper for paramEnv::getQuaternion

o#define QGET_INT(var)
wrapper for paramEnv::getInt that doesn't print errors

o#define QGET_FLOAT(var)
wrapper for paramEnv::getFloat that doesn't print errors

o#define QGET_DOUBLE(var)
wrapper for paramEnv::getDouble that doesn't print errors

o#define QGET_CHAR(var)
wrapper for paramEnv::getChar that doesn't print errors

o#define QGET_STRING(var)
wrapper for paramEnv::getString that doesn't print errors

o#define QGET_ENUM(var)
wrapper for paramEnv::getEnum that doesn't print errors

o#define QGET_TRIPLE(var)
wrapper for paramEnv::getTriple that doesn't print errors

o#define QGET_QUATERNION(var)
wrapper for paramEnv::getQuaternion that doesn't print errors


Direct child classes:
paramParser

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.