Gecode::BaseOptions Class Reference
Functionality by programming task » Programming models » Script commandline driver » Commandline options for running scripts

Base class for script options. More...

`#include <driver.hh>`

## Public Member Functions

| BaseOptions (const char *s)
| Initialize options for script with name s.
virtual void | help (void)
| Print help text.
void | add (Driver::BaseOption &o)
| Add new option o.
void | parse (int &argc, char *argv[])
| Parse options from arguments argv (number is argc).
const char * | name (void) const
| Return name of script.
void | name (const char *)
| Set name of script.
virtual | ~BaseOptions (void)
| Destructor.

## Protected Attributes

Driver::BaseOption * | fst
| First registered option.
Driver::BaseOption * | lst
| Last registered option.
const char * | _name
| Script name.

## Detailed Description

Base class for script options.

Definition at line 331 of file driver.hh.

## Constructor & Destructor Documentation

## BaseOptions()

Gecode::BaseOptions::BaseOptions | ( | const char * | s | ) |

Initialize options for script with name s.

Definition at line 483 of file options.cpp.

## ~BaseOptions()

Gecode::BaseOptions::~BaseOptions | ( | void |  | ) |

virtual

Destructor.

Definition at line 571 of file options.cpp.

## Member Function Documentation

## help()

void Gecode::BaseOptions::help | ( | void |  | ) |

virtual

Print help text.

Reimplemented in BIBDOptions, Gecode::FlatZinc::FlatZincOptions, Gecode::InstanceOptions, Gecode::SizeOptions, JobShopOptions, LangfordNumberOptions, SatOptions, SchurOptions, and SteelMillOptions.

Definition at line 494 of file options.cpp.

## add()

void Gecode::BaseOptions::add | ( | Driver::BaseOption & | o | ) |

Add new option o.

Definition at line 474 of file options.cpp.

## parse()

void Gecode::BaseOptions::parse | ( | int & | argc,
|  | char * | argv[] )

Parse options from arguments argv (number is argc).

The options are parsed from position one onwards until no more options are detected. After parsing, the parsed arguments have been removed.

Definition at line 548 of file options.cpp.

## name() [1/2]

const char * Gecode::BaseOptions::name | ( | void |  | ) | const

inline

Return name of script.

Definition at line 166 of file options.hpp.

## name() [2/2]

void Gecode::BaseOptions::name | ( | const char * | n | ) |

Set name of script.

Definition at line 488 of file options.cpp.

## Member Data Documentation

## fst

Driver::BaseOption* Gecode::BaseOptions::fst

protected

First registered option.

Definition at line 333 of file driver.hh.

## lst

Driver::BaseOption* Gecode::BaseOptions::lst

protected

Last registered option.

Definition at line 334 of file driver.hh.

## _name

const char* Gecode::BaseOptions::_name

protected

Script name.

Definition at line 335 of file driver.hh.

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

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