Gecode::Driver::BaseOption Class Referenceabstract

Base class for options. More...

`#include <driver.hh>`

## Public Member Functions

| BaseOption (const char *o, const char *e)
| Initialize for option o and explanation e.
virtual int | parse (int argc, char *argv[])=0
| Parse option at first position and return number of parsed arguments.
virtual void | help (void)=0
| Print help text.
virtual | ~BaseOption (void)
| Destructor.

## Static Public Member Functions

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

char * | argument (int argc, char *argv[]) const

## Protected Attributes

const char * | eopt
| String for option (excluding hyphen).
const char * | iopt
| String for option (including hyphen).
const char * | exp
| Short explanation.
BaseOption * | next
| Next option Check for option and return its argument.

## Detailed Description

Base class for options.

Definition at line 121 of file driver.hh.

## Constructor & Destructor Documentation

## BaseOption()

Gecode::Driver::BaseOption::BaseOption | ( | const char * | o,
|  | const char * | e )

Initialize for option o and explanation e.

Definition at line 99 of file options.cpp.

## ~BaseOption()

Gecode::Driver::BaseOption::~BaseOption | ( | void |  | ) |

virtual

Destructor.

Definition at line 102 of file options.cpp.

## Member Function Documentation

## argument()

char * Gecode::Driver::BaseOption::argument | ( | int | argc,
|  | char * | argv[] ) const

protected

Definition at line 78 of file options.cpp.

## parse()

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

pure virtual

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

Implemented in Gecode::Driver::BoolOption, Gecode::Driver::DoubleOption, Gecode::Driver::IntOption, Gecode::Driver::IplOption, Gecode::Driver::StringOption, Gecode::Driver::StringValueOption, Gecode::Driver::TraceOption, and Gecode::Driver::UnsignedIntOption.

## help()

virtual void Gecode::Driver::BaseOption::help | ( | void |  | ) |

pure virtual

Print help text.

Implemented in Gecode::Driver::BoolOption, Gecode::Driver::DoubleOption, Gecode::Driver::IntOption, Gecode::Driver::IplOption, Gecode::Driver::StringOption, Gecode::Driver::StringValueOption, Gecode::Driver::TraceOption, and Gecode::Driver::UnsignedIntOption.

## strdup()

char * Gecode::Driver::BaseOption::strdup | ( | const char * | s | ) |

static

Create heap-allocated copy of string s.

Definition at line 52 of file options.cpp.

## stredup()

char * Gecode::Driver::BaseOption::stredup | ( | const char * | s | ) |

static

Create heap-allocated copy of string s with hyphen added.

Definition at line 61 of file options.cpp.

## strdel()

void Gecode::Driver::BaseOption::strdel | ( | const char * | s | ) |

static

Delete heap-allocated copy of string s.

Definition at line 71 of file options.cpp.

## Member Data Documentation

## eopt

const char* Gecode::Driver::BaseOption::eopt

protected

String for option (excluding hyphen).

Definition at line 124 of file driver.hh.

## iopt

const char* Gecode::Driver::BaseOption::iopt

protected

String for option (including hyphen).

Definition at line 125 of file driver.hh.

## exp

const char* Gecode::Driver::BaseOption::exp

protected

Short explanation.

Definition at line 126 of file driver.hh.

## next

BaseOption* Gecode::Driver::BaseOption::next

protected

Next option Check for option and return its argument.

Definition at line 127 of file driver.hh.

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

- gecode/driver.hh
- gecode/driver/options.cpp