LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
|
Base class for options. More...
#include <OptionsFramework.hpp>
Public Member Functions | |
virtual void | addGeneric (po::options_description &opts) |
Appends generic options (those that the user can see) | |
virtual void | addHidden (po::options_description &opts) |
Appends hidden options (these generally match positional) | |
virtual void | addPositional (po::positional_options_description &opts) |
Appends positional options. | |
virtual std::string | print () const |
Returns a string listing the encapsulated options, suitable for logging. | |
virtual bool | check (po::variables_map &map) |
Validates passed options, returning true if there is a problem or false if not. | |
virtual bool | postConditions (po::variables_map &map) |
Post-processing of options returning true if there were no problems, otherwise false. | |
virtual std::string | help () const |
Returns a slice of the example command-line in the help output. | |
Base class for options.
Options may have a short (1-letter) equivalent. The convention is that core options (i.e. those declared in OptionsFramework.cpp) should all be lower-case. Package options should be in upper-case. Tool-specific options should all be long-form, unless they are commonly used, in which case it's recommended that they be upper-case.
|
inlinevirtual |
Appends generic options (those that the user can see)
Reimplemented in loos::OptionsFramework::BasicConvergence, ToolOptions, ToolOptions, ToolOptions, ToolOptions, ToolOptions, ToolOptions, ToolOptions, and loos::OptionsFramework::BasicWater.
|
inlinevirtual |
Appends hidden options (these generally match positional)
Reimplemented in ToolOptions.
|
inlinevirtual |
Appends positional options.
Reimplemented in ToolOptions.
|
inlinevirtual |
Validates passed options, returning true if there is a problem or false if not.
check() is typically used to validate positional options. For example, if you tool needs a command line that looks like:
* tool [options] min-value max-value number-of-bins *
then check() would verify that min-value, max-value, and number-of-bins were passed on the command-line. Another example is where there are mutually-exclusive options. This would be checked by check().
Reimplemented in ToolOptions.
|
inlinevirtual |
Returns a slice of the example command-line in the help output.
This is used specifically for positional options. If your tool has a command line that looks like:
* tool [options] min-value max-value selection *
The required arguments min-value, max-value, and selection are actually "hidden" options and will not be printed out when boost::program_options generates its help message. The AggregateOptions class will build the full command line for the help message by using the help() methods from each OptionsPackage, printing out something like the above on the command line as part of the help output.
Reimplemented in ToolOptions.
|
inlinevirtual |
Post-processing of options returning true if there were no problems, otherwise false.
postConditions() is called after options parsing and validation is complete. This is a mechanism for a subclass to do additional processing with the options it has been provided. For example, a model option subclass might read in the specified model and copy coordinates from an optionally specified file.
Note that the return value from postConditions() is the opposite of check(). Here, a true is returned if there are no problems.
Reimplemented in loos::OptionsFramework::BasicWater, ToolOptions, ToolOptions, ToolOptions, loos::OptionsFramework::BasicConvergence, and ToolOptions.
|
inlinevirtual |
Returns a string listing the encapsulated options, suitable for logging.
Reimplemented in loos::OptionsFramework::BasicConvergence, loos::OptionsFramework::BasicWater, ToolOptions, ToolOptions, ToolOptions, ToolOptions, and ToolOptions.