Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::SelectionFileOptionStorage Class Reference

#include <gromacs/selection/selectionfileoptionstorage.h>

+ Inheritance diagram for gmx::SelectionFileOptionStorage:
+ Collaboration diagram for gmx::SelectionFileOptionStorage:

Description

Implementation for a special option for reading selections from files.

Public Member Functions

 SelectionFileOptionStorage (const SelectionFileOption &settings, SelectionOptionManager *manager)
 Initializes the storage from option settings. More...
 
OptionInfooptionInfo () 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.
 
int valueCount () const override
 Returns the number of option values added so far.
 
std::vector< AnydefaultValues () const override
 Returns the default value(s) of the option. More...
 
std::vector< std::string > defaultValuesAsStrings () const override
 Returns the default value(s) of the option as strings. More...
 
std::vector< AnynormalizeValues (const std::vector< Any > &values) const override
 Converts given values to native representation for this option. More...
 
- 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 Any &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

- 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...
 

Constructor & Destructor Documentation

gmx::SelectionFileOptionStorage::SelectionFileOptionStorage ( const SelectionFileOption settings,
SelectionOptionManager manager 
)

Initializes the storage from option settings.

Parameters
[in]settingsStorage settings.
managerManager for this object.

Member Function Documentation

std::vector<Any> gmx::SelectionFileOptionStorage::defaultValues ( ) const
inlineoverridevirtual

Returns the default value(s) of the option.

The returned values should all be of the same type, but returning each as a separate any is currently simpler.

Currently, this can only be called before option values have been assigned.

Implements gmx::AbstractOptionStorage.

std::vector<std::string> gmx::SelectionFileOptionStorage::defaultValuesAsStrings ( ) const
inlineoverridevirtual

Returns the default value(s) of the option as strings.

If there is no default value, but defaultValueIfSet() is set, that is returned instead.

Currently, this can only be called before option values have been assigned.

Implements gmx::AbstractOptionStorage.

std::vector<Any> gmx::SelectionFileOptionStorage::normalizeValues ( const std::vector< Any > &  values) const
inlineoverridevirtual

Converts given values to native representation for this option.

For example, strings are parsed to the type that is actually used to store the options.

The return value only depends on the option type, not on the current value of the option, and the current value in the option is not changed.

Implements gmx::AbstractOptionStorage.


The documentation for this class was generated from the following files: