optparse::TypedOptionParser Class Reference

#include <TypedOptionParser.h>

Inheritance diagram for optparse::TypedOptionParser:

Inheritance graph
[legend]
Collaboration diagram for optparse::TypedOptionParser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TypedOptionParser (std::string usage="")
virtual ~TypedOptionParser ()
void add_option (std::string shrt_flag, std::string lng_flag, std::string destination, std::string help="", action_t act=STORE, type_t type=STRING, std::string dfault="", std::string allowed_values="")
void add_option (Teuchos::ParameterList &params, std::string shrt_flag, std::string lng_flag, std::string destination, std::string help="", action_t act=STORE, std::string allowed_values="")
std::string get_option (std::string option_name)
void set_parameter_list (Teuchos::ParameterList &params)

Protected Member Functions

virtual void set_option (Option &option, std::string argument)

Detailed Description

Option parser that can take default values from a Teuchos::ParamterList and also can update a Teuchos::ParamterList with the parsed options.

Definition at line 25 of file TypedOptionParser.h.


Constructor & Destructor Documentation

optparse::TypedOptionParser::TypedOptionParser ( std::string  usage = ""  )  [inline]

Definition at line 27 of file TypedOptionParser.h.

virtual optparse::TypedOptionParser::~TypedOptionParser (  )  [inline, virtual]

Definition at line 30 of file TypedOptionParser.h.


Member Function Documentation

void optparse::TypedOptionParser::add_option ( Teuchos::ParameterList &  params,
std::string  shrt_flag,
std::string  lng_flag,
std::string  destination,
std::string  help = "",
action_t  act = STORE,
std::string  allowed_values = "" 
)

Add an option to the parser. Default value and type are taken from a Teuchos parameter list entry.

Definition at line 20 of file TypedOptionParser.cpp.

References optparse::OptionParser::add_option(), optparse::BOOL, optparse::DOUBLE, optparse::INT, and optparse::STRING.

Here is the call graph for this function:

void optparse::TypedOptionParser::add_option ( std::string  shrt_flag,
std::string  lng_flag,
std::string  destination,
std::string  help = "",
action_t  act = STORE,
type_t  type = STRING,
std::string  dfault = "",
std::string  allowed_values = "" 
) [inline]

Add an option to the parser.

Parameters:
shrt_flag Short option name, like e.g. "-q".
lng_flag Long option name, like e.g. "--quiet"
destination Key under which the option argument is stored in the dictionary.
help Help string for generating the usage info.
act Action, one of STORE, STORE_TRUE, STORE_FALSE.
type Type info of the expected option argument. One of INT, DOUBLE, STRING, BOOL.
dfault Default value. Value stored in the dictionary if the option is not given.
allowed_values List of possible option values. A string of comma-separated allowed values. An empty string means that any value is allowed.

Reimplemented from optparse::OptionParser.

Definition at line 45 of file TypedOptionParser.h.

References optparse::OptionParser::add_option(), and optparse::OptionParser::help().

Here is the call graph for this function:

string optparse::TypedOptionParser::get_option ( std::string  option_name  ) 

Get option argument.

Parameters:
option_name Name of option, as given in "destination" parameter of "add_option".
Returns:
Option argument with type appendix removed.

Definition at line 86 of file TypedOptionParser.cpp.

References optparse::OptionParser::options.

virtual void optparse::TypedOptionParser::set_option ( Option option,
std::string  argument 
) [protected, virtual]

Function, that the parser uses to store an option argument or a default value in options dictionary. Overrides OptionParser::set_option. Additionally stores the type string in the argument.

Parameters:
option 
argument 

Reimplemented from optparse::OptionParser.

void optparse::TypedOptionParser::set_parameter_list ( Teuchos::ParameterList &  params  ) 

Store parsed options in Teuchos parameter list. Must be called after parse_args.

Parameters:
params Parameter list.

Definition at line 56 of file TypedOptionParser.cpp.

References optparse::OptionParser::options.


The documentation for this class was generated from the following files:
Generated on Fri Oct 26 13:35:18 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7