More generic way to obtain OptionInfo for options.
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 30 Aug 2012 19:08:55 +0000 (22:08 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Thu, 30 Aug 2012 20:13:41 +0000 (23:13 +0300)
commit030c229f14cd3c19962c5908fbbda479dae51175
tree8ca87e4daa458c728de0fd87aa4c696c223202a1
parent28c1cfd735f33d5020874b9f9b5a1dc0761bae00
More generic way to obtain OptionInfo for options.

Options::addOption() now returns a pointer to the OptionInfo object that
corresponds to the created option.  This provides a nicer and more
generic way compared to SelectionOption::getAdjuster(), and hopefully
makes it easier for static analysis and compilers to understand that the
info object always gets initialized to a non-NULL value.

Since this change requires the declaration of the corresponding info
object to be available whenever addOption() is called, one could also
get rid of the separate *optioninfo.h headers and merge them to the
corresponding *option.h headers.  This would reduce the number of files
for one option type, and possibly make it a bit easier to maintain.
Didn't do that in this change to keep it more clear.

Change-Id: I143592ed3a0750d3908c6bc8897179d9059ea546
src/gromacs/options/abstractoption.h
src/gromacs/options/basicoptions.h
src/gromacs/options/filenameoption.h
src/gromacs/options/options.cpp
src/gromacs/options/options.h
src/gromacs/options/tests/abstractoptionstorage.cpp
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoption.h
src/gromacs/selection/tests/selectionoption.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp