Support for non-string option value assignment
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 8 Jul 2016 15:10:12 +0000 (18:10 +0300)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 18 Aug 2016 12:35:46 +0000 (14:35 +0200)
commitfd73b6f79c4acc9471351ca296b60688bdeeab76
tree3a965f1b3acb8edeb8b65b1258a4afe2a0858973
parentc8fd6e2b8559c4c5a1420685c8635263f111b893
Support for non-string option value assignment

Make it possible to assign non-string values to options through
OptionsAssigner.  For now, the only thing that actually works is
assigning std::string values, and assigning the exact type stored for
the option.  Also, the list of supported conversions is initialized
separately for every instance of each option, but in practice that might
not matter that much.

This adds the infrastructure that allows assigning option values from
something like a JSON structure that already does data type conversions
during parsing.  The same infrastructure can also support #653.

Change-Id: I8f81d57da1b6eeac06a6ac9a8ab68bfa8ed0c148
18 files changed:
src/gromacs/options/abstractoption.cpp
src/gromacs/options/abstractoptionstorage.h
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptionstorage.h
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoptionstorage.h
src/gromacs/options/optionsassigner.cpp
src/gromacs/options/optionsassigner.h
src/gromacs/options/optionstoragetemplate.h
src/gromacs/options/tests/abstractoptionstorage.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/valueconverter.h [new file with mode: 0644]
src/gromacs/selection/selectionfileoptionstorage.h
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoptionstorage.h
src/gromacs/utility/strconvert.cpp
src/gromacs/utility/strconvert.h
src/gromacs/utility/variant.h [new file with mode: 0644]