Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
Gecode::Driver::StringOption Class Reference

String-valued option (integer value defined by strings) More...

#include <driver.hh>

Classes

class  Value
 Option value. More...
 

Public Member Functions

 StringOption (const char *o, const char *e, int v=0)
 Initialize for option o and explanation e and default value v.
 
void value (int v)
 Set default value to v.
 
int value (void) const
 Return current option value.
 
void add (int v, const char *o, const char *h=NULL)
 Add option value for value v, string o, and help text h.
 
virtual int parse (int argc, char *argv[])
 Parse option at first position and return number of parsed arguments.
 
virtual void help (void)
 Print help text.
 
virtual ~StringOption (void)
 Destructor.
 
- Public Member Functions inherited from Gecode::Driver::BaseOption
 BaseOption (const char *o, const char *e)
 Initialize for option o and explanation e.
 
virtual ~BaseOption (void)
 Destructor.
 

Protected Attributes

int cur
 Current value.
 
Valuefst
 First option value.
 
Valuelst
 Last option value.
 
- Protected Attributes inherited from Gecode::Driver::BaseOption
const char * eopt
 String for option (excluding hyphen)
 
const char * iopt
 String for option (including hyphen)
 
const char * exp
 Short explanation.
 
BaseOptionnext
 Next option Check for option and return its argument.
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::BaseOption
static char * strdup (const char *s)
 Create heap-allocated copy of string s.
 
static char * stredup (const char *s)
 Create heap-allocated copy of string s with hyphen added.
 
static void strdel (const char *s)
 Delete heap-allocated copy of string s.
 
- Protected Member Functions inherited from Gecode::Driver::BaseOption
char * argument (int argc, char *argv[]) const
 

Detailed Description

String-valued option (integer value defined by strings)

Definition at line 174 of file driver.hh.

Constructor & Destructor Documentation

◆ StringOption()

Gecode::Driver::StringOption::StringOption ( const char * o,
const char * e,
int v = 0 )
inline

Initialize for option o and explanation e and default value v.

Definition at line 55 of file options.hpp.

◆ ~StringOption()

Gecode::Driver::StringOption::~StringOption ( void )
virtual

Destructor.

Definition at line 186 of file options.cpp.

Member Function Documentation

◆ value() [1/2]

void Gecode::Driver::StringOption::value ( int v)
inline

Set default value to v.

Definition at line 58 of file options.hpp.

◆ value() [2/2]

int Gecode::Driver::StringOption::value ( void ) const
inline

Return current option value.

Definition at line 62 of file options.hpp.

◆ add()

void Gecode::Driver::StringOption::add ( int v,
const char * o,
const char * h = NULL )

Add option value for value v, string o, and help text h.

Definition at line 138 of file options.cpp.

◆ parse()

int Gecode::Driver::StringOption::parse ( int argc,
char * argv[] )
virtual

Parse option at first position and return number of parsed arguments.

Implements Gecode::Driver::BaseOption.

Definition at line 152 of file options.cpp.

◆ help()

void Gecode::Driver::StringOption::help ( void )
virtual

Print help text.

Implements Gecode::Driver::BaseOption.

Definition at line 167 of file options.cpp.

Member Data Documentation

◆ cur

int Gecode::Driver::StringOption::cur
protected

Current value.

Definition at line 184 of file driver.hh.

◆ fst

Value* Gecode::Driver::StringOption::fst
protected

First option value.

Definition at line 185 of file driver.hh.

◆ lst

Value* Gecode::Driver::StringOption::lst
protected

Last option value.

Definition at line 186 of file driver.hh.


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