From: Teemu Murtola Date: Fri, 17 Jul 2015 10:29:06 +0000 (+0300) Subject: Extract IOptionsContainer from Options X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=d140ff68d87ca3c962308fc03dadd4d99cdd9459;hp=5750bfe806310856448a1e7baf46a7d648d1185e;p=alexxy%2Fgromacs.git Extract IOptionsContainer from Options - Create a separate interface that declares addOption(), and make Options implement it. - Change methods that took an Options just to call addOption() to take an instance of the new interface instead of a full Options object. - Adjust documentation. This isolates callers that only provide options from other details of the options implementation, and allows further refactoring (that will provide more implementations for this same interface). Change-Id: I26d3f03602a8edd130d05231b3b0ee14b598ec8e --- diff --git a/docs/doxygen/user/analysisframework.md b/docs/doxygen/user/analysisframework.md index 29358489b9..46ce511fca 100644 --- a/docs/doxygen/user/analysisframework.md +++ b/docs/doxygen/user/analysisframework.md @@ -114,14 +114,14 @@ Input options {#section_analysisframework_options} To declare input data for the tool (typically, command-line options, including input files and selections), \ref module_options module is used. -The analysis tool code receives a pre-initialized gmx::Options object in one of -its initialization methods, and fills it with its input options. +The analysis tool code receives an instance of gmx::IOptionsContainer for one of +its initialization methods, and uses it to provide its input options. Basic options are declared in basicoptions.h, and also gmx::SelectionOption is used in the same manner. For each option, the tool declares a local variable that will receive the value for that option. After the options are parsed from the command line (by the framework), the tool code can read the values from -these variables. The option declarations, and other information filled into -the gmx::Options object, are also used to provide help to the user (also +these variables. The option declarations filled into the +gmx::IOptionsContainer object are also used to provide help to the user (also handled by the framework). See the documentation for gmx::TrajectoryAnalysisModule and the [options module documentation](\ref module_options) for more details. diff --git a/share/template/template.cpp b/share/template/template.cpp index 3cb55d5e89..3b9d3ddf47 100644 --- a/share/template/template.cpp +++ b/share/template/template.cpp @@ -47,7 +47,7 @@ class AnalysisTemplate : public TrajectoryAnalysisModule public: AnalysisTemplate(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top); @@ -82,7 +82,7 @@ AnalysisTemplate::AnalysisTemplate() void -AnalysisTemplate::initOptions(Options *options, +AnalysisTemplate::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { diff --git a/src/gromacs/analysisdata/modules/plot.cpp b/src/gromacs/analysisdata/modules/plot.cpp index e60648e4fa..572c2d5a10 100644 --- a/src/gromacs/analysisdata/modules/plot.cpp +++ b/src/gromacs/analysisdata/modules/plot.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -57,7 +57,7 @@ #include "gromacs/legacyheaders/oenv.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/options/timeunitmanager.h" #include "gromacs/selection/selectioncollection.h" #include "gromacs/utility/exceptions.h" @@ -95,7 +95,7 @@ AnalysisDataPlotSettings::setSelectionCollection(const SelectionCollection *sele void -AnalysisDataPlotSettings::addOptions(Options *options) +AnalysisDataPlotSettings::initOptions(IOptionsContainer *options) { options->addOption(StringOption("xvg").enumValue(g_plotFormats) .defaultValue("xmgrace") diff --git a/src/gromacs/analysisdata/modules/plot.h b/src/gromacs/analysisdata/modules/plot.h index 78c48d5eec..2eb8b82159 100644 --- a/src/gromacs/analysisdata/modules/plot.h +++ b/src/gromacs/analysisdata/modules/plot.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -55,7 +55,7 @@ namespace gmx { class AnalysisDataValue; -class Options; +class IOptionsContainer; class SelectionCollection; /*! \brief @@ -109,7 +109,7 @@ class AnalysisDataPlotSettings * * \param[in,out] options Options object to which options are added. */ - void addOptions(Options *options); + void initOptions(IOptionsContainer *options); private: const SelectionCollection *selections_; diff --git a/src/gromacs/commandline/cmdlineoptionsmodule.h b/src/gromacs/commandline/cmdlineoptionsmodule.h index ae7c004d01..529bc55f98 100644 --- a/src/gromacs/commandline/cmdlineoptionsmodule.h +++ b/src/gromacs/commandline/cmdlineoptionsmodule.h @@ -52,6 +52,7 @@ template class ConstArrayRef; class CommandLineModuleManager; class ICommandLineModule; +class IOptionsContainer; class Options; /*! \brief @@ -230,7 +231,7 @@ class ICommandLineOptionsModule * the module to \p options. Output values from options should be * stored in member variables. */ - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, ICommandLineOptionsModuleSettings *settings) = 0; /*! \brief * Called after all option values have been set. diff --git a/src/gromacs/commandline/tests/cmdlinehelpmodule.cpp b/src/gromacs/commandline/tests/cmdlinehelpmodule.cpp index ba62e55e03..871abe926f 100644 --- a/src/gromacs/commandline/tests/cmdlinehelpmodule.cpp +++ b/src/gromacs/commandline/tests/cmdlinehelpmodule.cpp @@ -107,7 +107,7 @@ TEST_F(CommandLineHelpModuleTest, PrintsHelpOnTopic) * * \ingroup module_commandline */ -void initOptionsBasic(gmx::Options *options, +void initOptionsBasic(gmx::IOptionsContainer *options, gmx::ICommandLineOptionsModuleSettings *settings) { const char *const desc[] = { diff --git a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h index deb27ddb3a..9cb462f6b2 100644 --- a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h +++ b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h @@ -108,7 +108,7 @@ class MockOptionsModule : public gmx::ICommandLineOptionsModule ~MockOptionsModule(); MOCK_METHOD1(init, void(gmx::CommandLineModuleSettings *settings)); - MOCK_METHOD2(initOptions, void(gmx::Options *options, gmx::ICommandLineOptionsModuleSettings *settings)); + MOCK_METHOD2(initOptions, void(gmx::IOptionsContainer *options, gmx::ICommandLineOptionsModuleSettings *settings)); MOCK_METHOD1(optionsFinished, void(gmx::Options *options)); MOCK_METHOD0(run, int()); }; diff --git a/src/gromacs/gmxpreprocess/insert-molecules.cpp b/src/gromacs/gmxpreprocess/insert-molecules.cpp index b4f77af2b3..aefe099563 100644 --- a/src/gromacs/gmxpreprocess/insert-molecules.cpp +++ b/src/gromacs/gmxpreprocess/insert-molecules.cpp @@ -51,6 +51,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/options/options.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/random/random.h" @@ -318,7 +319,7 @@ class InsertMolecules : public ICommandLineOptionsModule { } - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, ICommandLineOptionsModuleSettings *settings); virtual void optionsFinished(Options *options); @@ -340,7 +341,7 @@ class InsertMolecules : public ICommandLineOptionsModule int enumRot_; }; -void InsertMolecules::initOptions(Options *options, +void InsertMolecules::initOptions(IOptionsContainer *options, ICommandLineOptionsModuleSettings *settings) { const char *const desc[] = { diff --git a/src/gromacs/options.h b/src/gromacs/options.h index a6bc7e8362..01993c4d81 100644 --- a/src/gromacs/options.h +++ b/src/gromacs/options.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -39,12 +39,21 @@ * *

Basic Use

* - * Basic interface for providing options is implemented by the Options class - * and classes defined in basicoptions.h for specifying individual options. - * Only these are needed if a class wants to provide a set of standard options. - * When creating an Options object and adding options, it is possible to add - * descriptions for individual options as well as for the whole set of options. - * These can then be used to write out help text. + * Code that provides options does so using methods in gmx::IOptionsContainer + * and classes defined in basicoptions.h. + * Only these are needed if a class wants to provide a set of standard options + * (other modules can provide additional option types, such as + * gmx::SelectionOption). + * For each option, the caller provides an output variable that will receive + * the final value of the option once user input has been parsed. + * When adding options, it is possible to also provide descriptions for the + * options for use in generated help text. + * + * Generic code that handles the user input does so by creating a gmx::Options + * instance and passing it (as gmx::IOptionsContainer) to the classes that add + * the actual options. It can then use a parser to set values to the options. + * Final values for the options can be inspected in the code that added the + * individual options, from the provided output variables. * * The sequence charts below provides an overview of how the options work from * usage perspective. They include two fictional modules, A and B, that provide @@ -52,9 +61,9 @@ * typical initialization sequence, where the main routine creates an options * object, and calls an initOptions() method in each module that can provide * options (the modules may also request their submodules to add their own - * options). Each module uses gmx::Options::addOption() to add the options - * they require, and specify output variables into which the options values are - * stored. + * options). Each module uses gmx::IOptionsContainer::addOption() to add the + * options they require, and specify output variables into which the options + * values are stored. * \msc * main, * options [ label="Options", URL="\ref gmx::Options" ], @@ -64,11 +73,11 @@ * main box B [ label="main owns all objects" ]; * main => options [ label="create", URL="\ref gmx::Options::Options()" ]; * main => A [ label="initOptions()" ]; - * A => options [ label="addOption()", URL="\ref gmx::Options::addOption()" ]; + * A => options [ label="addOption()", URL="\ref gmx::IOptionsContainer::addOption()" ]; * ...; * main << A; * main => B [ label="initOptions()" ]; - * B => options [ label="addOption()", URL="\ref gmx::Options::addOption()" ]; + * B => options [ label="addOption()", URL="\ref gmx::IOptionsContainer::addOption()" ]; * ...; * main << B; * \endmsc @@ -77,7 +86,7 @@ * the input into option-value pairs (one option may have multiple values), and * passes these into the gmx::Options object, which is responsible for * converting them into the appropriate types and storing the values into the - * variables provided in the calls to gmx::Options::addOption(). + * variables provided in the calls to gmx::IOptionsContainer::addOption(). * \msc * main, * parser [ label="parser" ], @@ -123,7 +132,7 @@ * To implement new option types, it is necessary to subclass the templates * OptionTemplate and OptionStorageTemplate with the type of the values that * the option should provide as the template argument. After this is done, it - * is possible to add options of this new type using Options::addOption(). + * is possible to add options of this new type using IOptionsContainer::addOption(). * * To implement new parsers, one can use OptionsAssigner, which provides an * interface to set values in an Options object. diff --git a/src/gromacs/options/CMakeLists.txt b/src/gromacs/options/CMakeLists.txt index a04d94e1a1..d565ace779 100644 --- a/src/gromacs/options/CMakeLists.txt +++ b/src/gromacs/options/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2010,2012,2013,2014, by the GROMACS development team, led by +# Copyright (c) 2010,2012,2013,2014,2015, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -40,6 +40,7 @@ gmx_install_headers( basicoptions.h filenameoption.h filenameoptionmanager.h + ioptionscontainer.h optionfiletype.h optionflags.h options.h diff --git a/src/gromacs/options/filenameoptionmanager.cpp b/src/gromacs/options/filenameoptionmanager.cpp index 1a627cd85c..f83c63a1ec 100644 --- a/src/gromacs/options/filenameoptionmanager.cpp +++ b/src/gromacs/options/filenameoptionmanager.cpp @@ -50,7 +50,7 @@ #include "gromacs/fileio/filenm.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/utility/arrayref.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/fileredirector.h" @@ -149,7 +149,7 @@ void FileNameOptionManager::disableInputOptionChecking(bool bDisable) } void FileNameOptionManager::addDefaultFileNameOption( - Options *options, const char *name) + IOptionsContainer *options, const char *name) { options->addOption( StringOption(name).store(&impl_->defaultFileName_) diff --git a/src/gromacs/options/filenameoptionmanager.h b/src/gromacs/options/filenameoptionmanager.h index fd2099a40b..a8182162b2 100644 --- a/src/gromacs/options/filenameoptionmanager.h +++ b/src/gromacs/options/filenameoptionmanager.h @@ -53,7 +53,7 @@ namespace gmx class FileNameOptionInfo; class IFileInputRedirector; -class Options; +class IOptionsContainer; /*! \brief * Handles interaction of file name options with global options. @@ -132,7 +132,7 @@ class FileNameOptionManager : public IOptionManager * instead from an option-specific default * (FileNameOption::defaultBaseName()). */ - void addDefaultFileNameOption(Options *options, const char *name); + void addDefaultFileNameOption(IOptionsContainer *options, const char *name); /*! \brief * Completes file name option values. diff --git a/src/gromacs/options/ioptionscontainer.h b/src/gromacs/options/ioptionscontainer.h new file mode 100644 index 0000000000..1e8eddb2c9 --- /dev/null +++ b/src/gromacs/options/ioptionscontainer.h @@ -0,0 +1,136 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2015, by the GROMACS development team, led by + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + * and including many others, as listed in the AUTHORS file in the + * top-level source directory and at http://www.gromacs.org. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ +/*! \file + * \brief + * Declares gmx::IOptionsContainer. + * + * \author Teemu Murtola + * \inpublicapi + * \ingroup module_options + */ +#ifndef GMX_OPTIONS_IOPTIONSCONTAINER_H +#define GMX_OPTIONS_IOPTIONSCONTAINER_H + +#include "gromacs/options/abstractoption.h" +#include "gromacs/utility/gmxassert.h" + +namespace gmx +{ + +/*! \brief + * Interface for adding input options. + * + * This interface provides methods to add new options. + * Standard usage is for code to receive this interface and populate it with + * supported options: + * \code + // + std::string arg1; + int arg2; + + void MyClass::initOptions(gmx::IOptionsContainer *options) + { + options->addOption(gmx::StringOption("arg1").store(&arg1)); + options->addOption(gmx::IntegerOption("arg2").store(&arg2)); + } + \endcode + * The caller can collect options from multiple sources into a single container + * (a gmx::Options), and use a parser implementation such as CommandLineParser + * to provide values for the options. + * + * Header basicoptions.h provides declarations of several standard + * option types for use with addOption(). Documentation of those classes + * also give more examples of how to define options. + * + * \inpublicapi + * \ingroup module_options + */ +class IOptionsContainer +{ + public: + /*! \brief + * Adds a recognized option. + * + * \param[in] settings Option description. + * \returns OptionInfo object for the created option (never NULL). + * \throws APIError if invalid option settings are provided. + * + * This method provides the internal implementation, but in most cases + * the templated method is called from user code. + * See the templated method for more details. + */ + virtual OptionInfo *addOption(const AbstractOption &settings) = 0; + /*! \brief + * Adds a recognized option. + * + * \tparam OptionType Type of the options description object. + * \param[in] settings Option description. + * \returns OptionInfo object for the created option (never NULL). + * \throws APIError if invalid option settings are provided. + * + * The return value is a pointer for more convenient use in callers: + * often callers need to declare the variable that will hold the return + * value in wider scope than would be achieved by declaring it at the + * site where addOption() is called. + * The returned pointer must not be freed. + * + * See \link Options class documentation \endlink for example usage. + * + * \libinternal + * \p OptionType::InfoType must specify a type that derives from + * OptionInfo and matches the type that is returned by + * AbstractOptionStorage::optionInfo() for the storage object that + * corresponds to \p OptionType. + */ + template + typename OptionType::InfoType *addOption(const OptionType &settings) + { + OptionInfo *info + = addOption(static_cast(settings)); + GMX_ASSERT(info->isType(), + "Mismatching option info type declaration and implementation"); + return info->toType(); + } + + protected: + // Disallow deletion through the interface. + // (no need for the virtual, but some compilers warn otherwise) + virtual ~IOptionsContainer(); + +}; + +} // namespace + +#endif diff --git a/src/gromacs/options/options.cpp b/src/gromacs/options/options.cpp index c0cff70203..9b422c9640 100644 --- a/src/gromacs/options/options.cpp +++ b/src/gromacs/options/options.cpp @@ -63,6 +63,14 @@ IOptionManager::~IOptionManager() { } +/******************************************************************** + * IOptionsContainer + */ + +IOptionsContainer::~IOptionsContainer() +{ +} + /******************************************************************** * Options::Impl */ diff --git a/src/gromacs/options/options.h b/src/gromacs/options/options.h index d62319b0a0..b312218a56 100644 --- a/src/gromacs/options/options.h +++ b/src/gromacs/options/options.h @@ -48,9 +48,8 @@ #include -#include "gromacs/options/abstractoption.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/utility/classhelpers.h" -#include "gromacs/utility/gmxassert.h" namespace gmx { @@ -83,32 +82,10 @@ class IOptionManager /*! \brief * Collection of options. * - * This class provides a standard interface for implementing input options. - * Standard usage is to write a method that creates an Options that is owned by - * the object, populates it with supported options, and then returns it: - * \code - // - using gmx::Options; - Options options("common", "Common Options"); - std::string arg1; - int arg2; - - // - using gmx::StringOption; - using gmx::IntegerOption; - options.addOption(StringOption("arg1").store(&arg1)); - options.addOption(IntegerOption("arg2").store(&arg2)); - return &options; - \endcode - * The caller of that method can then use a parser implementation such as - * CommandLineParser to provide values for the options. + * See \ref module_options for an overview of how the options work. + * The IOptionsContainer interface documents how to add options. * - * Header basicoptions.h provides declarations of several standard - * option types for use with addOption(). Documentation of those classes - * also give more examples of how to define options. - * - * In order to keep the public interface of this class simple and to reduce - * build dependencies on objects that simply provide options, functionality + * In order to keep the public interface of this class simple, functionality * to assign values to options is provided by a separate OptionsAssigner class. * Similarly, functionality for looping over all options (e.g., for writing out * help) is provided by OptionsIterator. @@ -116,7 +93,7 @@ class IOptionManager * \inpublicapi * \ingroup module_options */ -class Options +class Options : public IOptionsContainer { public: /*! \brief @@ -175,49 +152,10 @@ class Options * If an attempt is made, the function asserts. */ void addSubSection(Options *section); - /*! \brief - * Adds a recognized option to the collection. - * - * \param[in] settings Option description. - * \returns OptionInfo object for the created option (never NULL). - * \throws APIError if invalid option settings are provided. - * - * This method provides the internal implementation, but in most cases - * the templated method is called from user code. - * See the templated method for more details. - */ - OptionInfo *addOption(const AbstractOption &settings); - /*! \brief - * Adds a recognized option to the collection. - * - * \tparam OptionType Type of the options description object. - * \param[in] settings Option description. - * \returns OptionInfo object for the created option (never NULL). - * \throws APIError if invalid option settings are provided. - * - * The return value is a pointer for more convenient use in callers: - * often callers need to declare the variable that will hold the return - * value in wider scope than would be achieved by declaring it at the - * site where addOption() is called. - * The returned pointer must not be freed. - * - * See \link Options class documentation \endlink for example usage. - * - * \libinternal - * \p OptionType::InfoType must specify a type that derives from - * OptionInfo and matches the type that is returned by - * AbstractOptionStorage::optionInfo() for the storage object that - * corresponds to \p OptionType. - */ - template - typename OptionType::InfoType *addOption(const OptionType &settings) - { - OptionInfo *info - = addOption(static_cast(settings)); - GMX_ASSERT(info->isType(), - "Mismatching option info type declaration and implementation"); - return info->toType(); - } + + // From IOptionsContainer + virtual OptionInfo *addOption(const AbstractOption &settings); + using IOptionsContainer::addOption; //! Returns true if option \p name is set. bool isSet(const char *name) const; diff --git a/src/gromacs/options/timeunitmanager.cpp b/src/gromacs/options/timeunitmanager.cpp index b687c31bb7..87b5e477b7 100644 --- a/src/gromacs/options/timeunitmanager.cpp +++ b/src/gromacs/options/timeunitmanager.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -48,6 +48,7 @@ #include #include "gromacs/options/basicoptions.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/options/options.h" #include "gromacs/options/optionsvisitor.h" #include "gromacs/utility/arrayref.h" @@ -138,7 +139,7 @@ void TimeUnitManager::setTimeUnitFromEnvironment() } } -void TimeUnitManager::addTimeUnitOption(Options *options, const char *name) +void TimeUnitManager::addTimeUnitOption(IOptionsContainer *options, const char *name) { options->addOption(StringOption(name).enumValue(g_timeUnits) .defaultValue(g_timeUnits[timeUnit()]) diff --git a/src/gromacs/options/timeunitmanager.h b/src/gromacs/options/timeunitmanager.h index 76e08312be..d35f6e5ae9 100644 --- a/src/gromacs/options/timeunitmanager.h +++ b/src/gromacs/options/timeunitmanager.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2014, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -48,6 +48,7 @@ namespace gmx { +class IOptionsContainer; class Options; /*! \brief @@ -130,7 +131,7 @@ class TimeUnitManager * Adds an enum option to \p options to select the time unit for this * manager. */ - void addTimeUnitOption(Options *options, const char *name); + void addTimeUnitOption(IOptionsContainer *options, const char *name); /*! \brief * Scales user input values given to time options. * diff --git a/src/gromacs/selection/selectioncollection.cpp b/src/gromacs/selection/selectioncollection.cpp index b7ee4d0b2d..2c07363e20 100644 --- a/src/gromacs/selection/selectioncollection.cpp +++ b/src/gromacs/selection/selectioncollection.cpp @@ -57,7 +57,7 @@ #include "gromacs/onlinehelp/helpmanager.h" #include "gromacs/onlinehelp/helpwritercontext.h" #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selhelp.h" #include "gromacs/topology/topology.h" @@ -496,7 +496,7 @@ SelectionCollection::~SelectionCollection() void -SelectionCollection::initOptions(Options *options) +SelectionCollection::initOptions(IOptionsContainer *options) { const char * const debug_levels[] = { "no", "basic", "compile", "eval", "full" }; diff --git a/src/gromacs/selection/selectioncollection.h b/src/gromacs/selection/selectioncollection.h index 826f20a04d..663667abc7 100644 --- a/src/gromacs/selection/selectioncollection.h +++ b/src/gromacs/selection/selectioncollection.h @@ -60,7 +60,7 @@ struct t_trxframe; namespace gmx { -class Options; +class IOptionsContainer; class SelectionCompiler; class SelectionEvaluator; class TextInputStream; @@ -130,7 +130,7 @@ class SelectionCollection * position types (see setReferencePosType() and setOutputPosType()) * and debugging flags. */ - void initOptions(Options *options); + void initOptions(IOptionsContainer *options); /*! \brief * Sets the default reference position handling for a selection diff --git a/src/gromacs/selection/selectionoption.h b/src/gromacs/selection/selectionoption.h index 0af37dddc7..199b19128f 100644 --- a/src/gromacs/selection/selectionoption.h +++ b/src/gromacs/selection/selectionoption.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -178,7 +178,7 @@ class SelectionOption : public OptionTemplate * appropriate. Otherwise, values that are provided before adjustments will * need to follow the more strict checks. In most cases in trajectory analysis * (which is the main use case for selection options), the adjustments should - * be done in TrajectoryAnalysisModule::initOptionsDone() for them to take + * be done in TrajectoryAnalysisModule::optionsFinished() for them to take * place before interactive selection prompts. * * An instance of this class for a selection option can be obtained with diff --git a/src/gromacs/selection/tests/selectioncollection.cpp b/src/gromacs/selection/tests/selectioncollection.cpp index 436abee87d..095a203953 100644 --- a/src/gromacs/selection/tests/selectioncollection.cpp +++ b/src/gromacs/selection/tests/selectioncollection.cpp @@ -47,7 +47,7 @@ #include "gromacs/fileio/trx.h" #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/selection/indexutil.h" #include "gromacs/selection/selection.h" #include "gromacs/topology/topology.h" diff --git a/src/gromacs/simd/tests/base.cpp b/src/gromacs/simd/tests/base.cpp index c13862a222..34438ac276 100644 --- a/src/gromacs/simd/tests/base.cpp +++ b/src/gromacs/simd/tests/base.cpp @@ -39,7 +39,7 @@ #include #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/utility/basedefinitions.h" #include "testutils/testoptions.h" diff --git a/src/gromacs/trajectoryanalysis/analysismodule.h b/src/gromacs/trajectoryanalysis/analysismodule.h index f2756b88f0..6735b21c4c 100644 --- a/src/gromacs/trajectoryanalysis/analysismodule.h +++ b/src/gromacs/trajectoryanalysis/analysismodule.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -62,6 +62,7 @@ class AbstractAnalysisData; class AnalysisData; class AnalysisDataHandle; class AnalysisDataParallelOptions; +class IOptionsContainer; class Options; class SelectionCollection; class TopologyInformation; @@ -249,7 +250,7 @@ class TrajectoryAnalysisModule * If settings depend on the option values provided by the user, see * optionsFinished(). */ - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) = 0; /*! \brief * Called after all option values have been set. diff --git a/src/gromacs/trajectoryanalysis/modules/angle.cpp b/src/gromacs/trajectoryanalysis/modules/angle.cpp index 8968c49690..c9826aed25 100644 --- a/src/gromacs/trajectoryanalysis/modules/angle.cpp +++ b/src/gromacs/trajectoryanalysis/modules/angle.cpp @@ -55,6 +55,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/options/options.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/selection/selection.h" @@ -245,7 +246,7 @@ class Angle : public TrajectoryAnalysisModule public: Angle(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void optionsFinished(Options *options, TrajectoryAnalysisSettings *settings); @@ -304,7 +305,7 @@ Angle::Angle() void -Angle::initOptions(Options *options, TrajectoryAnalysisSettings *settings) +Angle::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { "[THISMODULE] computes different types of angles between vectors.", diff --git a/src/gromacs/trajectoryanalysis/modules/distance.cpp b/src/gromacs/trajectoryanalysis/modules/distance.cpp index bc9fb9687e..32f9faf3a7 100644 --- a/src/gromacs/trajectoryanalysis/modules/distance.cpp +++ b/src/gromacs/trajectoryanalysis/modules/distance.cpp @@ -53,7 +53,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" @@ -76,7 +76,7 @@ class Distance : public TrajectoryAnalysisModule public: Distance(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top); @@ -132,7 +132,7 @@ Distance::Distance() void -Distance::initOptions(Options *options, TrajectoryAnalysisSettings *settings) +Distance::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { "[THISMODULE] calculates distances between pairs of positions", diff --git a/src/gromacs/trajectoryanalysis/modules/freevolume.cpp b/src/gromacs/trajectoryanalysis/modules/freevolume.cpp index a99215cffd..a07cebffd9 100644 --- a/src/gromacs/trajectoryanalysis/modules/freevolume.cpp +++ b/src/gromacs/trajectoryanalysis/modules/freevolume.cpp @@ -53,7 +53,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/random/random.h" #include "gromacs/selection/nbsearch.h" @@ -85,28 +85,16 @@ namespace class FreeVolume : public TrajectoryAnalysisModule { public: - //! Constructor FreeVolume(); - - //! Destructor virtual ~FreeVolume(); - //! Set the options and setting - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); - - //! First routine called by the analysis framework virtual void initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top); - - //! Call for each frame of the trajectory virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc, TrajectoryAnalysisModuleData *pdata); - - //! Last routine called by the analysis framework virtual void finishAnalysis(int nframes); - - //! Routine to write output, that is additional over the built-in virtual void writeOutput(); private: @@ -162,7 +150,7 @@ FreeVolume::~FreeVolume() void -FreeVolume::initOptions(Options *options, +FreeVolume::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { diff --git a/src/gromacs/trajectoryanalysis/modules/pairdist.cpp b/src/gromacs/trajectoryanalysis/modules/pairdist.cpp index 0d365ffa34..43b47b6c33 100644 --- a/src/gromacs/trajectoryanalysis/modules/pairdist.cpp +++ b/src/gromacs/trajectoryanalysis/modules/pairdist.cpp @@ -55,7 +55,7 @@ #include "gromacs/fileio/trx.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/selection/nbsearch.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" @@ -105,7 +105,7 @@ class PairDistance : public TrajectoryAnalysisModule public: PairDistance(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top); @@ -177,7 +177,7 @@ PairDistance::PairDistance() void -PairDistance::initOptions(Options *options, TrajectoryAnalysisSettings *settings) +PairDistance::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { "[THISMODULE] calculates pairwise distances between one reference", diff --git a/src/gromacs/trajectoryanalysis/modules/rdf.cpp b/src/gromacs/trajectoryanalysis/modules/rdf.cpp index 448095bdf3..5a11f9f369 100644 --- a/src/gromacs/trajectoryanalysis/modules/rdf.cpp +++ b/src/gromacs/trajectoryanalysis/modules/rdf.cpp @@ -61,6 +61,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/options/options.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/selection/nbsearch.h" @@ -96,7 +97,7 @@ class Rdf : public TrajectoryAnalysisModule public: Rdf(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void optionsFinished(Options *options, TrajectoryAnalysisSettings *settings); @@ -200,7 +201,7 @@ Rdf::Rdf() } void -Rdf::initOptions(Options *options, TrajectoryAnalysisSettings *settings) +Rdf::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { "[THISMODULE] calculates radial distribution functions from one", diff --git a/src/gromacs/trajectoryanalysis/modules/sasa.cpp b/src/gromacs/trajectoryanalysis/modules/sasa.cpp index edff30830f..2d14a8f00c 100644 --- a/src/gromacs/trajectoryanalysis/modules/sasa.cpp +++ b/src/gromacs/trajectoryanalysis/modules/sasa.cpp @@ -60,7 +60,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" @@ -287,7 +287,7 @@ class Sasa : public TrajectoryAnalysisModule public: Sasa(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top); @@ -406,7 +406,7 @@ Sasa::Sasa() } void -Sasa::initOptions(Options *options, TrajectoryAnalysisSettings *settings) +Sasa::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { "[THISMODULE] computes solvent accessible surface areas.", diff --git a/src/gromacs/trajectoryanalysis/modules/select.cpp b/src/gromacs/trajectoryanalysis/modules/select.cpp index 0239d18860..7a49a0e839 100644 --- a/src/gromacs/trajectoryanalysis/modules/select.cpp +++ b/src/gromacs/trajectoryanalysis/modules/select.cpp @@ -62,7 +62,7 @@ #include "gromacs/fileio/trxio.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" #include "gromacs/topology/topology.h" @@ -261,7 +261,7 @@ class Select : public TrajectoryAnalysisModule public: Select(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void optionsFinished(Options *options, TrajectoryAnalysisSettings *settings); @@ -327,7 +327,7 @@ Select::Select() void -Select::initOptions(Options *options, TrajectoryAnalysisSettings *settings) +Select::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { "[THISMODULE] writes out basic data about dynamic selections.", diff --git a/src/gromacs/trajectoryanalysis/runnercommon.cpp b/src/gromacs/trajectoryanalysis/runnercommon.cpp index f7db229341..befa025b17 100644 --- a/src/gromacs/trajectoryanalysis/runnercommon.cpp +++ b/src/gromacs/trajectoryanalysis/runnercommon.cpp @@ -53,6 +53,7 @@ #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/options/options.h" #include "gromacs/pbcutil/rmpbc.h" #include "gromacs/selection/indexutil.h" @@ -167,7 +168,7 @@ TrajectoryAnalysisRunnerCommon::~TrajectoryAnalysisRunnerCommon() void -TrajectoryAnalysisRunnerCommon::initOptions(Options *options) +TrajectoryAnalysisRunnerCommon::initOptions(IOptionsContainer *options) { TrajectoryAnalysisSettings &settings = impl_->settings_; @@ -200,7 +201,7 @@ TrajectoryAnalysisRunnerCommon::initOptions(Options *options) settings.impl_->timeUnitManager.addTimeUnitOption(options, "tu"); // Add plot options. - settings.impl_->plotSettings.addOptions(options); + settings.impl_->plotSettings.initOptions(options); // Add common options for trajectory processing. if (!settings.hasFlag(TrajectoryAnalysisSettings::efNoUserRmPBC)) diff --git a/src/gromacs/trajectoryanalysis/runnercommon.h b/src/gromacs/trajectoryanalysis/runnercommon.h index 3fd5057ec6..82fea3bf79 100644 --- a/src/gromacs/trajectoryanalysis/runnercommon.h +++ b/src/gromacs/trajectoryanalysis/runnercommon.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -49,6 +49,7 @@ struct t_trxframe; namespace gmx { +class IOptionsContainer; class Options; class SelectionCollection; class TopologyInformation; @@ -79,7 +80,7 @@ class TrajectoryAnalysisRunnerCommon * * \param[in,out] options Options object to add the options to. */ - void initOptions(Options *options); + void initOptions(IOptionsContainer *options); //! Scales time option values according to the time unit set. void scaleTimeOptions(Options *options); /*! \brief diff --git a/src/gromacs/trajectoryanalysis/tests/test_selection.cpp b/src/gromacs/trajectoryanalysis/tests/test_selection.cpp index c0868646e6..a6a0b62320 100644 --- a/src/gromacs/trajectoryanalysis/tests/test_selection.cpp +++ b/src/gromacs/trajectoryanalysis/tests/test_selection.cpp @@ -41,7 +41,7 @@ #include "gmxpre.h" #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" #include "gromacs/trajectoryanalysis/analysismodule.h" @@ -59,7 +59,7 @@ class SelectionTester : public TrajectoryAnalysisModule SelectionTester(); virtual ~SelectionTester(); - virtual void initOptions(Options *options, + virtual void initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings); virtual void initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top); @@ -99,7 +99,7 @@ SelectionTester::printSelections() } void -SelectionTester::initOptions(Options *options, +SelectionTester::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings) { static const char *const desc[] = { diff --git a/src/programs/mdrun/tests/moduletest.cpp b/src/programs/mdrun/tests/moduletest.cpp index b793af46c5..3f4bd2656a 100644 --- a/src/programs/mdrun/tests/moduletest.cpp +++ b/src/programs/mdrun/tests/moduletest.cpp @@ -47,7 +47,7 @@ #include "gromacs/gmxpreprocess/grompp.h" #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/basenetwork.h" #include "gromacs/utility/gmxmpi.h" diff --git a/src/testutils/stringtest.cpp b/src/testutils/stringtest.cpp index ad63a444f7..2ff4a776a2 100644 --- a/src/testutils/stringtest.cpp +++ b/src/testutils/stringtest.cpp @@ -48,7 +48,7 @@ #include #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/utility/textreader.h" #include "testutils/refdata.h" diff --git a/src/testutils/testfilemanager.cpp b/src/testutils/testfilemanager.cpp index da988ea99a..e3841fb48c 100644 --- a/src/testutils/testfilemanager.cpp +++ b/src/testutils/testfilemanager.cpp @@ -52,7 +52,7 @@ #include #include "gromacs/options/basicoptions.h" -#include "gromacs/options/options.h" +#include "gromacs/options/ioptionscontainer.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/path.h" diff --git a/src/testutils/testoptions.cpp b/src/testutils/testoptions.cpp index 976b8d7989..5f63a6d970 100644 --- a/src/testutils/testoptions.cpp +++ b/src/testutils/testoptions.cpp @@ -79,7 +79,7 @@ class TestOptionsRegistry } //! Initializes the options from all the provides. - void initOptions(Options *options); + void initOptions(IOptionsContainer *options); private: TestOptionsRegistry() {} @@ -92,7 +92,7 @@ class TestOptionsRegistry GMX_DISALLOW_COPY_AND_ASSIGN(TestOptionsRegistry); }; -void TestOptionsRegistry::initOptions(Options *options) +void TestOptionsRegistry::initOptions(IOptionsContainer *options) { // TODO: Have some deterministic order for the options; now it depends on // the order in which the global initializers are run. @@ -111,7 +111,7 @@ void registerTestOptions(const char *name, TestOptionsProvider *provider) TestOptionsRegistry::getInstance().add(name, provider); } -void initTestOptions(Options *options) +void initTestOptions(IOptionsContainer *options) { TestOptionsRegistry::getInstance().initOptions(options); } diff --git a/src/testutils/testoptions.h b/src/testutils/testoptions.h index bdc980504c..62dd76926f 100644 --- a/src/testutils/testoptions.h +++ b/src/testutils/testoptions.h @@ -50,7 +50,7 @@ namespace gmx { -class Options; +class IOptionsContainer; namespace test { @@ -72,7 +72,7 @@ class TestOptionsProvider * * \param options The options need to be added here. */ - virtual void initOptions(Options *options) = 0; + virtual void initOptions(IOptionsContainer *options) = 0; protected: virtual ~TestOptionsProvider() {} @@ -106,7 +106,7 @@ void registerTestOptions(const char *name, TestOptionsProvider *provider); * * \ingroup module_testutils */ -void initTestOptions(Options *options); +void initTestOptions(IOptionsContainer *options); // Uncrustify screws up the indentation for the example otherwise. /* *INDENT-OFF* */ @@ -127,7 +127,7 @@ void initTestOptions(Options *options); * Typical usage: * \code #include "gromacs/options/basicoptions.h" - #include "gromacs/options/options.h" + #include "gromacs/options/ioptionscontainer.h" #include "testutils/testoptions.h" @@ -170,12 +170,12 @@ void initTestOptions(Options *options); { \ ::gmx::test::registerTestOptions(#name, this); \ } \ - virtual void initOptions(::gmx::Options *options); \ + virtual void initOptions(::gmx::IOptionsContainer *options); \ }; \ \ static name s_ ## name ## Instance; \ \ - void name::initOptions(::gmx::Options *options) + void name::initOptions(::gmx::IOptionsContainer *options) } // namespace test } // namespace gmx