paramxx  1.0.7
Par Class Reference

#include <Par.h>

+ Inheritance diagram for Par:
+ Collaboration diagram for Par:

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 More...
 
virtual int pgeti (void) const throw ( ParFileException )
 only defined in RealPar More...
 
virtual long pgetl (void) const throw ( ParFileException )
 only defined in LongPar More...
 
virtual void pgetstr (char result[], size_t size) const throw ( ParFileException )
 only defined in LongPar More...
 
virtual string pgetstring (void) const throw ( ParFileException )
 only defined in StringPar More...
 
virtual void print (ostream &os) const
 only defined in StringPar More...
 
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.

Member Enumeration Documentation

◆ ParFileDelimit

The delimit within the par file

◆ ParType

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

Constructor & Destructor Documentation

◆ ~Par()

virtual Par::~Par ( void  )
inlinevirtual

The destructor.

◆ Par()

Par::Par ( void  )
inline

The default constructor.

Member Function Documentation

◆ get_mode()

string Par::get_mode ( void  ) const
inline

Get the mode of the parameter file

Referenced by ParFile::pgetstring().

◆ get_name()

string Par::get_name ( void  ) const
inline

Get the name member of the class.

◆ get_prompt()

string Par::get_prompt ( void  ) const
inline

Get the prompt of the parameter

Referenced by ParFile::print().

◆ pgetb()

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.

Referenced by ParFile::pgetb().

◆ pgetd()

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.

Referenced by ParFile::pgetd().

◆ pgeti()

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

only defined in RealPar

Reimplemented in LongPar.

Referenced by ParFile::pgeti().

◆ pgetl()

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

only defined in LongPar

Reimplemented in LongPar.

Referenced by ParFile::pgetl().

◆ pgetstr()

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

only defined in LongPar

Reimplemented in StringPar.

◆ pgetstring()

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

only defined in StringPar

Reimplemented in StringPar.

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

◆ plist()

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.

◆ print()

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.

Referenced by CommentPar::plist().

Friends And Related Function Documentation

◆ operator<< [1/2]

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

This operator outputs the contents of the object.

◆ operator<< [2/2]

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

This operator outputs the contents of the object.


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