parameter Class Reference

Class that allows reading named numeric parameters from the command line via -<paramName>=<value> or from a file via -param=<file>. More...

#include <paramTable.h>

List of all members.

Public Types

enum  { tableSize = 101 }

Public Methods

double operator() ()
 Returns the current value of the parameter.

void changeValue (double newValue)
int hasBeenChanged ()
 parameter (const char *name_, double minValue_, double value_, double maxValue_)
 ~parameter ()

Static Public Methods

void readAll (int argc, char **argv, int minArgs=0, int maxArgs=1)
 Processes the arguement list. More...

int howMany ()

Static Private Methods

unsigned int hash (const char *name_)
parameter * lookup (const char *name_, int hashValue_)
parameter * lookup (const char *name_)
void parseLine (int argc, char **arv, int minArgs=0, int maxArgs=1)
void readFromFile (const char *fileName)
double convert (const char *buffer, const char *errorKey)

Private Attributes

double value
double maxValue
double minValue
const char * name
int changeCounter
parameter * next
parameter * prev

Static Private Attributes

int numParameters
parameter * hashHeader [tableSize]


Detailed Description

Class that allows reading named numeric parameters from the command line via -<paramName>=<value> or from a file via -param=<file>.

Note: for now the format of the parameter file is described in utilib/src/io/paramTable.doc.

Author:
Jonathan Eckstein


Member Function Documentation

void parameter::readAll int    argc,
char **    argv,
int    minArgs = 0,
int    maxArgs = 1
[static]
 

Processes the arguement list.

Note: minArgs and maxArgs refer to the number of command-line arguments that can not be parsed as parameters. If the number of such arguments is outside the range [minArgs, maxArgs ], an error is signalled.


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