Split EnumIntOption from StringOption
commit9abcc254befaf9ef41b237ccc43067d7b1377ca7
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 21 Aug 2015 10:37:04 +0000 (21 13:37 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 19 Oct 2015 15:45:40 +0000 (19 17:45 +0200)
tree133167fa2c8fcbd9224e0506f39cc15e9657fed5
parentd4dfa8cf772b943e0b587cc0473e8acb30551072
Split EnumIntOption from StringOption

Remove storeEnumIndex() from StringOption, and add EnumOption that
supports the same input values as StringOption with enumValue(), but
stores the result in an integer variable.

This removes complexity from StringOption(), where managing all possible
combinations of store(), storeEnumIndex(), and their defaults reasonably
was quite complicated.

Increase use of enum types instead of string comparisons.

Change-Id: I2f1bca204af83dc404b6f20842119d1b7d4a27ad
18 files changed:
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesDefaultValuesFromVariables.xml [new file with mode: 0644]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptions.h
src/gromacs/options/basicoptionstorage.h
src/gromacs/options/tests/option.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/timeunitmanager.cpp
src/gromacs/selection/selectioncollection.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/pairdist.cpp
src/gromacs/trajectoryanalysis/modules/rdf.cpp
src/gromacs/trajectoryanalysis/modules/select.cpp
src/testutils/refdata.cpp