GamsOptions Class Reference

Class to handle the access to a GAMS options file. More...

#include <GamsOptions.hpp>

Collaboration diagram for GamsOptions:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GamsOptions (GamsHandler &gams_, const char *solvername)
 Constructor for GamsOptions class.
 ~GamsOptions ()
 Destructor.
bool readOptionsFile (const char *optfilename)
 Reads an options file.
bool isKnown (const char *optname)
 Checks whether an option exists.
bool isDefined (const char *optname)
 Checks whether the user specified some option.
bool getBool (const char *optname)
 Gets the value of a boolean option.
int getInteger (const char *optname)
 Gets the value of an integer option.
double getDouble (const char *optname)
 Gets the value of a real (double) option.
char * getString (const char *optname, char *buffer)
 Gets the value of a string option.
void setBool (const char *optname, bool bval)
 Sets the value of a boolean option.
void setInteger (const char *optname, int ival)
 Sets the value of an integer option.
void setDouble (const char *optname, double dval)
 Sets the value of a double option.
void setString (const char *optname, const char *sval)
 Sets the value of a string option.

Private Attributes

GamsHandlergams
optRec * optionshandle

Detailed Description

Class to handle the access to a GAMS options file.

Definition at line 22 of file GamsOptions.hpp.


Constructor & Destructor Documentation

GamsOptions::GamsOptions ( GamsHandler gams_,
const char *  solvername 
)

Constructor for GamsOptions class.

Initialization of options handle. Reading of the file "<systemdir>/opt<solvername>.def" to learn which options are supported.

Parameters:
gams_ A GAMS handler to get access to the system directory name and other stuff.
solvername The name of your solver.

GamsOptions::~GamsOptions (  ) 

Destructor.


Member Function Documentation

bool GamsOptions::readOptionsFile ( const char *  optfilename  ) 

Reads an options file.

Parameters:
optfilename Giving NULL for optfilename will read nothing and returns true.

bool GamsOptions::isKnown ( const char *  optname  ) 

Checks whether an option exists.

Returns:
True, if the option exists, i.e., defined in the options definition file. False otherwise.

bool GamsOptions::isDefined ( const char *  optname  ) 

Checks whether the user specified some option.

Parameters:
optname The name of the option.
Returns:
True, if the option had been specified in the option file.

bool GamsOptions::getBool ( const char *  optname  )  [inline]

Gets the value of a boolean option.

Parameters:
optname The name of the option.

Definition at line 60 of file GamsOptions.hpp.

References getInteger().

int GamsOptions::getInteger ( const char *  optname  ) 

Gets the value of an integer option.

Parameters:
optname The name of the option.

Referenced by getBool().

double GamsOptions::getDouble ( const char *  optname  ) 

Gets the value of a real (double) option.

Parameters:
optname The name of the option.

char* GamsOptions::getString ( const char *  optname,
char *  buffer 
)

Gets the value of a string option.

Parameters:
optname The name of the option.
buffer A buffer where the value can be stored (it should be large enough).

void GamsOptions::setBool ( const char *  optname,
bool  bval 
) [inline]

Sets the value of a boolean option.

Parameters:
optname The name of the option.
bval The value to set.

Definition at line 79 of file GamsOptions.hpp.

References setInteger().

void GamsOptions::setInteger ( const char *  optname,
int  ival 
)

Sets the value of an integer option.

Parameters:
optname The name of the option.
ival The value to set.

Referenced by setBool().

void GamsOptions::setDouble ( const char *  optname,
double  dval 
)

Sets the value of a double option.

Parameters:
optname The name of the option.
dval The value to set.

void GamsOptions::setString ( const char *  optname,
const char *  sval 
)

Sets the value of a string option.

Parameters:
optname The name of the option.
sval The value to set.


Member Data Documentation

GamsHandler& GamsOptions::gams [private]

Definition at line 24 of file GamsOptions.hpp.

struct optRec* GamsOptions::optionshandle [private]

Definition at line 26 of file GamsOptions.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Dec 30 03:01:29 2008 for GAMSlinks by  doxygen 1.4.7