Gromacs
2019.3
|
#include <gromacs/options/basicoptionstorage.h>
Converts, validates, and stores boolean values.
Public Member Functions | |
BooleanOptionStorage (const BooleanOption &settings) | |
Initializes the storage from option settings. More... | |
OptionInfo & | optionInfo () override |
Returns an option info object corresponding to this option. | |
std::string | typeString () const override |
Returns a short string describing the type of the option. | |
std::string | formatSingleValue (const bool &value) const override |
Formats a single value as a string. More... | |
bool | defaultValue () const |
Returns the default value for this option. More... | |
Public Member Functions inherited from gmx::OptionStorageTemplate< bool > | |
int | valueCount () const override |
Returns the number of option values added so far. More... | |
std::vector< Variant > | defaultValues () const override |
std::vector< std::string > | defaultValuesAsStrings () const override |
Public Member Functions inherited from gmx::AbstractOptionStorage | |
bool | isSet () const |
Returns true if the option has been set. | |
bool | isBoolean () const |
Returns true if the option is a boolean option. More... | |
bool | isHidden () const |
Returns true if the option is a hidden option. | |
bool | isRequired () const |
Returns true if the option is required. | |
bool | isVector () const |
Returns true if the option is vector-valued. | |
const std::string & | name () const |
Returns the name of the option. | |
const std::string & | description () const |
Returns the description of the option set by the calling code. | |
bool | defaultValueIfSetExists () const |
Returns true if defaultValueIfSet() value is specified. | |
int | minValueCount () const |
Returns the minimum number of values required in one set. | |
int | maxValueCount () const |
Returns the maximum allowed number of values in one set (-1 = no limit). | |
virtual std::string | formatExtraDescription () const |
Formats additional description for the option. More... | |
void | startSource () |
Starts adding values from a new source for the option. More... | |
void | startSet () |
Starts adding a new set of values for the option. More... | |
void | appendValue (const Variant &value) |
Adds a new value for the option. More... | |
void | finishSet () |
Performs validation and/or actions once a set of values has been added. More... | |
void | finish () |
Performs validation and/or actions once all values have been added. More... | |
Additional Inherited Members | |
Public Types inherited from gmx::OptionStorageTemplateSimple< bool > | |
typedef OptionStorageTemplateSimple < bool > | MyBase |
Alias for the template class for use in base classes. | |
Public Types inherited from gmx::OptionStorageTemplate< bool > | |
typedef OptionStorageTemplate < bool > | MyBase |
Alias for the template class for use in base classes. | |
typedef std::vector< bool > | ValueList |
Type of the container that contains the current values. | |
Protected Types inherited from gmx::OptionStorageTemplateSimple< bool > | |
typedef OptionValueConverterSimple < bool > | ConverterType |
Alias for the converter parameter type for initConverter(). | |
Protected Types inherited from gmx::OptionStorageTemplate< bool > | |
typedef std::unique_ptr < IOptionValueStore< bool > > | StorePointer |
Smart pointer for managing the final storage interface. | |
Protected Member Functions inherited from gmx::OptionStorageTemplateSimple< bool > | |
OptionStorageTemplateSimple (const OptionTemplate< bool, U > &settings, OptionFlags staticFlags=OptionFlags()) | |
Initializes the storage. | |
OptionStorageTemplateSimple (const AbstractOption &settings, typename OptionStorageTemplate< bool >::StorePointer store) | |
Initializes the storage. | |
std::vector< Variant > | normalizeValues (const std::vector< Variant > &values) const override |
virtual bool | processValue (const bool &value) const |
Post-processes a value after conversion to the output type. More... | |
virtual Variant | normalizeValue (const bool &value) const |
Converts a single value to normalized type. More... | |
Protected Member Functions inherited from gmx::OptionStorageTemplate< bool > | |
OptionStorageTemplate (const OptionTemplate< bool, U > &settings, OptionFlags staticFlags=OptionFlags()) | |
Initializes the storage from option settings. More... | |
OptionStorageTemplate (const AbstractOption &settings, StorePointer store) | |
Initializes the storage from base option settings. More... | |
void | clearSet () override |
Removes all values from temporary storage for a set. More... | |
virtual void | processSetValues (ValueList *values) |
Processes values for a set after all have been converted. More... | |
void | processSet () override |
Performs validation and/or actions once a set of values has been added. More... | |
void | processAll () override |
Performs validation and/or actions once all values have been added. More... | |
void | addValue (const bool &value) |
Adds a value to a temporary storage. More... | |
void | commitValues () |
Commits values added with addValue(). More... | |
void | setDefaultValue (const bool &value) |
Sets the default value for the option. More... | |
void | setDefaultValueIfSet (const bool &value) |
Sets the default value if set for the option. More... | |
ArrayRef< bool > | values () |
Provides derived classes access to the current list of values. More... | |
ArrayRef< const bool > | values () const |
Provides derived classes access to the current list of values. | |
Protected Member Functions inherited from gmx::AbstractOptionStorage | |
AbstractOptionStorage (const AbstractOption &settings, OptionFlags staticFlags) | |
Initializes the storage object from the settings object. More... | |
void | markAsSet () |
Marks the option as set. | |
bool | hasFlag (OptionFlag flag) const |
Returns true if the given flag is set. | |
void | setFlag (OptionFlag flag) |
Sets the given flag. | |
void | clearFlag (OptionFlag flag) |
Clears the given flag. | |
void | setMinValueCount (int count) |
Sets a new minimum number of values required in one set. More... | |
void | setMaxValueCount (int count) |
Sets a new maximum number of values required in one set. More... | |
|
inlineexplicit |
Initializes the storage from option settings.
[in] | settings | Storage settings. |
|
inline |
Returns the default value for this option.
|
overridevirtual |
Formats a single value as a string.
[in] | value | Value to format. |
value
formatted as a string.The derived class must provide this method to format values a strings. Called by defaultValuesAsStrings() to do the actual formatting.
Implements gmx::OptionStorageTemplate< bool >.