Par Class Reference

#include <Par.h>

Inheritance diagram for Par:

Inheritance graph
[legend]

List of all members.

Public Types

enum  ParFileDelimit { DELIMIT = ',' }
enum  ParType {
  PARNAME, PARTYPE, PARMODE, PARVALUE,
  PARMINIMUM, PARMAXIMUM, PARPROMPT
}
enum  ParamMode {
  AUTOS = 'a', BATCH = 'b', hIDDEN = 'h', HIDDEN = 'H',
  QUERRY = 'q', LEARN = 'l'
}
enum  ParamType {
  BOOLEAN = 'b', COMMENT = 'c', INTEGER = 'i', REAL = 'r',
  STRING = 's'
}
enum  NumTokens { NUMTOKENS = 7 }

Public Member Functions

virtual ~Par (void)
 Par (void)
 Par (ParTxt &par)
int check_value (const char *str) const
virtual void plist (ostream &os) const
string get_name (void) const
string get_mode (void) const
string get_prompt (void) const
string get_value (void) const
virtual bool pgetb (void) const throw ( ParFileException )
virtual double pgetd (void) const throw ( ParFileException )
 only defined in BoolPar
virtual int pgeti (void) const throw ( ParFileException )
 only defined in RealPar
virtual long pgetl (void) const throw ( ParFileException )
 only defined in LongPar
virtual void pgetstr (char result[], size_t size) const throw ( ParFileException )
 only defined in LongPar
virtual string pgetstring (void) const throw ( ParFileException )
 only defined in StringPar
virtual void print (ostream &os) const
 only defined in StringPar
virtual void set_val (const string &str) throw ( ParFileException, Exception )

Static Public Member Functions

static int my_tokenize (char *str, char *delimit, char ***tokens) throw ( Exception )
static void delete_tokens (char **ptr)
static bool is_indirrect (const string &str, char delimit=')')

Protected Member Functions

void not_between_limits (char str[], const char *left, const string &left_val, const char *right, const string &right_val) const

Protected Attributes

vector< string > parameter

Friends

ostream & operator<< (ostream &os, Par &par)
ostream & operator<< (ostream &os, Par *par)


Detailed Description

The base class for the boolean, double, integer and string parameters.

Definition at line 41 of file Par.h.


Member Enumeration Documentation

The delimit within the par file

Definition at line 64 of file Par.h.

The position of the parameters.

Enumerator:
PARNAME  The name of the parameter
PARTYPE  The type of the parameter
PARMODE  The mode of the parameter
PARVALUE  The value of the parameter
PARMINIMUM  The minimum value of the parameter
PARMAXIMUM  The maximum value of the parameter
PARPROMPT  The name of the parameter

Definition at line 69 of file Par.h.


Constructor & Destructor Documentation

virtual Par::~Par ( void   )  [inline, virtual]

The destructor.

Definition at line 89 of file Par.h.

Par::Par ( void   )  [inline]

The default constructor.

Definition at line 94 of file Par.h.


Member Function Documentation

void Par::plist ( ostream &  os  )  const [virtual]

All the derived Par class, with the exception of the comment class, will call this function to print on the screen the parameters with the format name = val prompt

Reimplemented in CommentPar.

Definition at line 105 of file Par.cc.

References PARMODE, PARNAME, PARPROMPT, and PARVALUE.

string Par::get_name ( void   )  const [inline]

Get the name member of the class.

Definition at line 110 of file Par.h.

References PARNAME.

string Par::get_mode ( void   )  const [inline]

Get the mode of the parameter file

Definition at line 115 of file Par.h.

References PARMODE.

string Par::get_prompt ( void   )  const [inline]

Get the prompt of the parameter

Definition at line 120 of file Par.h.

References PARPROMPT.

bool Par::pgetb ( void   )  const throw ( ParFileException ) [virtual]

The user is trying to get the boolean value of a parameter which is anything but a boolean.

Reimplemented in BoolPar.

Definition at line 146 of file Par.cc.

Referenced by ParFile::pgetb().

double Par::pgetd ( void   )  const throw ( ParFileException ) [virtual]

only defined in BoolPar

The user is trying to get the double value of a parameter which is anything but a double.

Reimplemented in RealPar.

Definition at line 153 of file Par.cc.

Referenced by ParFile::pgetd().

int Par::pgeti ( void   )  const throw ( ParFileException ) [virtual]

only defined in RealPar

Reimplemented in LongPar.

Definition at line 160 of file Par.cc.

Referenced by ParFile::pgeti().

long Par::pgetl ( void   )  const throw ( ParFileException ) [virtual]

only defined in LongPar

Reimplemented in LongPar.

Definition at line 167 of file Par.cc.

Referenced by ParFile::pgetl().

void Par::pgetstr ( char  result[],
size_t  size 
) const throw ( ParFileException ) [virtual]

only defined in LongPar

Reimplemented in StringPar.

Definition at line 174 of file Par.cc.

string Par::pgetstring ( void   )  const throw ( ParFileException ) [virtual]

only defined in StringPar

Reimplemented in StringPar.

Definition at line 182 of file Par.cc.

Referenced by ParFile::pgetstr(), and ParFile::pgetstring().

void Par::print ( ostream &  os  )  const [virtual]

only defined in StringPar

To output the parameter of the form: name,type,mode,val,min,max,prompt

Reimplemented in StringPar.

Definition at line 189 of file Par.cc.

Referenced by CommentPar::plist(), and ParFile::print().


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
Par par 
) [friend]

This operator outputs the contents of the object.

Definition at line 46 of file Par.h.

ostream& operator<< ( ostream &  os,
Par par 
) [friend]

This operator outputs the contents of the object.

Definition at line 54 of file Par.h.


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

Generated on Thu Oct 2 17:54:24 2008 for paramxx by  doxygen 1.5.6