Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

_option< T > Class Template Reference
[Command line options library]

A variable in your program, controlled by a command line option. More...

#include <options.h>

Inherits _optionbase.

Inheritance diagram for _option< T >:

Inheritance graph
Collaboration diagram for _option< T >:

Collaboration graph
List of all members.

Public Member Functions

 _option (std::string init_name, T &variable)
 Standard constructor: creates a new _option with name init_name, linked to variable.
 _option (const _option &other)
 Copy constructor: creates a new option with the same name and variable reference as other.
void SetValue (std::string value)
 Sets the value of the linked variable to whatever value parses out to be.
std::string & GetValue (std::string &value)
 Fills value with a string describing the value of the linked variable, and returns a reference.
std::string TypeName ()
 Returns a string describing the C/C++ type of this variable.

Public Attributes

T * ptr
 Pointer to the variable that this option affects.
std::string name
 The name of this parameter.

Detailed Description

template<typename T>
class _option< T >

A variable in your program, controlled by a command line option.

An _option<T> links a variable of type T with a command line option that's identified by a name (string). The variable name (known only to the programmer and to the C++ compiler) and the option name (known only to the programmer and to the user) may coincide, but need not. Objects of type _option<T> are not usually created directly by the programmer, but rather by the Options::Add() method.

_option<T> inherits an interface from _optionbase, and provides storage for a pointer to its variable. The SetValue() and GetValue() members affect the variable that the _option<T> object refers to.

The documentation for this class was generated from the following file:
Generated on Wed Jun 14 22:25:27 2006 for linalg by  doxygen 1.4.4