Gromacs
5.1.5
|
Provides functionality for handling options.
Basic interface for providing options is implemented by the Options class and classes defined in basicoptions.h for specifying individual options. Only these are needed if a class wants to provide a set of standard options. When creating an Options object and adding options, it is possible to add descriptions for individual options as well as for the whole set of options. These can then be used to write out help text.
The sequence charts below provides an overview of how the options work from usage perspective. They include two fictional modules, A and B, that provide options, and a main routine that manages these. The first chart shows a typical initialization sequence, where the main routine creates an options object, and calls an initOptions() method in each module that can provide options (the modules may also request their submodules to add their own options). Each module uses gmx::Options::addOption() to add the options they require, and specify output variables into which the options values are stored.
After all options have been specified, they can be parsed. A parser splits the input into option-value pairs (one option may have multiple values), and passes these into the gmx::Options object, which is responsible for converting them into the appropriate types and storing the values into the variables provided in the calls to gmx::Options::addOption().
After all options have been parsed (possibly using multiple different parsers), gmx::Options::finish() is called. This performs final validation of the options and may further adjust the values stored in the output variables (see documentation on individual option types on when this may happen).
Module Command Line Program Management (commandline) implements classes that assign option values from command line and produce help for programs that use the command line parser.
Classes | |
class | gmx::AbstractOption |
Abstract base class for specifying option properties. More... | |
class | gmx::OptionTemplate< T, U > |
Templated base class for constructing concrete option settings classes. More... | |
class | gmx::OptionInfo |
Gives information and allows modifications to an option after creation. More... | |
class | gmx::BooleanOption |
Specifies an option that provides boolean values. More... | |
class | gmx::IntegerOption |
Specifies an option that provides integer values. More... | |
class | gmx::Int64Option |
Specifies an option that provides 64-bit integer values. More... | |
class | gmx::DoubleOption |
Specifies an option that provides floating-point (double) values. More... | |
class | gmx::FloatOption |
Specifies an option that provides floating-point (float) values. More... | |
class | gmx::StringOption |
Specifies an option that provides string values. More... | |
class | gmx::BooleanOptionInfo |
Wrapper class for accessing boolean option information. More... | |
class | gmx::IntegerOptionInfo |
Wrapper class for accessing integer option information. More... | |
class | gmx::Int64OptionInfo |
Wrapper class for accessing 64-bit integer option information. More... | |
class | gmx::DoubleOptionInfo |
Wrapper class for accessing floating-point option information. More... | |
class | gmx::FloatOptionInfo |
Wrapper class for accessing floating-point option information. More... | |
class | gmx::StringOptionInfo |
Wrapper class for accessing string option information. More... | |
class | gmx::FileNameOption |
Specifies an option that provides file names. More... | |
class | gmx::FileNameOptionInfo |
Wrapper class for accessing file name option information. More... | |
class | gmx::OptionManagerInterface |
Base class for option managers. More... | |
class | gmx::Options |
Collection of options. More... | |
class | gmx::TimeUnitManager |
Provides common functionality for time unit conversions. More... | |
Typedefs | |
typedef FloatOption | gmx::RealOption |
Typedef for either DoubleOption or FloatOption, depending on precision. More... | |
typedef FloatOptionInfo | gmx::RealOptionInfo |
Typedef for either DoubleOptionInfo or FloatOptionInfo, depending on precision. More... | |
Enumerations | |
enum | gmx::OptionFileType { eftUnknown, eftTopology, eftTrajectory, eftPDB, eftIndex, eftPlot, eftGenericData, eftOptionFileType_NR } |
Purpose of file(s) provided through an option. | |
Directories | |
directory | options |
Extensible Handling of Options (options) | |
Files | |
file | abstractoption.h |
Defines gmx::AbstractOption, gmx::OptionTemplate and gmx::OptionInfo. | |
file | basicoptions.h |
Declares option objects for basic option types. | |
file | filenameoption.h |
Declares gmx::FileNameOption and gmx::FileNameOptionInfo. | |
file | filenameoptionmanager.h |
Declares gmx::FileNameOptionManager. | |
file | optionfiletype.h |
Defines an enumeration type for specifying file types for options. | |
file | optionflags.h |
Defines flags used in option implementation. | |
file | options.h |
Declares gmx::Options. | |
file | timeunitmanager.h |
Declares gmx::TimeUnitManager. | |
file | options.h |
Public API convenience header for handling of options. | |
Typedef for either DoubleOption or FloatOption, depending on precision.
Generally, new would be better using DoubleOption, but this is provided for cases where the output value needs to be of type real
for some reason.
Typedef for either DoubleOptionInfo or FloatOptionInfo, depending on precision.
Generally, new would be better using DoubleOption, but this is provided for cases where the output value needs to be of type real
for some reason.