From 7a6907d2184cf7bf3ce09e83e9d902f9787a3eb0 Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Wed, 15 Jul 2015 08:46:23 +0300 Subject: [PATCH 1/1] Change naming convention for C++ interfaces - Describe the new convention in naming.rst, together with some rationale. The new I prefix is a very common convention, and makes the code generally more readable than a long Interface suffix that does not add much information. - Do a bulk rename from \w*Interface to I\1, skipping ::testing::WithParamInterface. - Rename helptopicinterface.h to ihelptopic.h to keep the naming consistent. - Run uncrustify on the result. Change-Id: I4b27ae0164ad89e45693d35055730caab0832bed --- docs/dev-manual/naming.rst | 7 +- docs/dev-manual/relocatable-binaries.rst | 2 +- docs/dev-manual/testutils.rst | 2 +- docs/doxygen/lib/wrapperbinary.md | 14 +-- docs/doxygen/user/analysisdata.md | 6 +- docs/doxygen/user/usinglibrary.md | 6 +- src/gromacs/analysisdata.h | 26 +++--- src/gromacs/analysisdata/abstractdata.cpp | 4 +- src/gromacs/analysisdata/abstractdata.h | 8 +- src/gromacs/analysisdata/analysisdata.h | 12 +-- src/gromacs/analysisdata/datamodule.h | 12 +-- .../analysisdata/datamodulemanager.cpp | 32 +++---- src/gromacs/analysisdata/datamodulemanager.h | 32 +++---- src/gromacs/analysisdata/dataproxy.h | 8 +- src/gromacs/analysisdata/framelocaldata.h | 6 +- .../analysisdata/modules/frameaverager.h | 8 +- .../analysisdata/tests/analysisdata.cpp | 8 +- src/gromacs/analysisdata/tests/arraydata.cpp | 4 +- src/gromacs/analysisdata/tests/datatest.h | 12 +-- .../analysisdata/tests/mock_datamodule.cpp | 10 +- .../analysisdata/tests/mock_datamodule.h | 6 +- src/gromacs/commandline.h | 6 +- src/gromacs/commandline/cmdlinehelpmodule.cpp | 92 +++++++++---------- src/gromacs/commandline/cmdlinehelpmodule.h | 16 ++-- src/gromacs/commandline/cmdlinehelpwriter.cpp | 18 ++-- src/gromacs/commandline/cmdlineinit.cpp | 6 +- src/gromacs/commandline/cmdlineinit.h | 14 +-- src/gromacs/commandline/cmdlinemodule.h | 10 +- .../commandline/cmdlinemodulemanager.cpp | 20 ++-- .../commandline/cmdlinemodulemanager.h | 20 ++-- .../commandline/cmdlineoptionsmodule.cpp | 30 +++--- .../commandline/cmdlineoptionsmodule.h | 34 +++---- .../commandline/cmdlineprogramcontext.cpp | 10 +- .../commandline/cmdlineprogramcontext.h | 14 +-- .../tests/cmdlinemodulemanagertest.cpp | 2 +- .../tests/cmdlinemodulemanagertest.h | 8 +- .../tests/cmdlineprogramcontext.cpp | 2 +- src/gromacs/gmxlib/copyrite.cpp | 6 +- src/gromacs/gmxlib/oenv.cpp | 10 +- .../gmxpreprocess/insert-molecules.cpp | 6 +- src/gromacs/gmxpreprocess/insert-molecules.h | 6 +- src/gromacs/legacyheaders/copyrite.h | 10 +- src/gromacs/legacyheaders/oenv.h | 10 +- src/gromacs/onlinehelp-doc.h | 2 +- src/gromacs/onlinehelp/helpmanager.cpp | 14 +-- src/gromacs/onlinehelp/helpmanager.h | 6 +- src/gromacs/onlinehelp/helptopic.cpp | 8 +- src/gromacs/onlinehelp/helptopic.h | 20 ++-- src/gromacs/onlinehelp/helpwritercontext.cpp | 12 +-- .../{helptopicinterface.h => ihelptopic.h} | 16 ++-- src/gromacs/onlinehelp/tests/mock_helptopic.h | 2 +- src/gromacs/options/filenameoptionmanager.cpp | 6 +- src/gromacs/options/filenameoptionmanager.h | 6 +- src/gromacs/options/optionmanagercontainer.h | 10 +- src/gromacs/options/options.cpp | 6 +- src/gromacs/options/options.h | 8 +- .../selection/selectioncollection-impl.h | 4 +- .../selection/selectionoptionmanager.h | 4 +- src/gromacs/selection/selhelp.cpp | 2 +- src/gromacs/selection/selhelp.h | 4 +- .../trajectoryanalysis/cmdlinerunner.cpp | 2 +- src/gromacs/utility.h | 2 +- src/gromacs/utility/datafilefinder.h | 2 +- src/gromacs/utility/exceptions.cpp | 12 +-- src/gromacs/utility/fileredirector.cpp | 12 +-- src/gromacs/utility/fileredirector.h | 20 ++-- src/gromacs/utility/programcontext.cpp | 12 +-- src/gromacs/utility/programcontext.h | 20 ++-- src/programs/legacymodules.cpp | 6 +- src/testutils/cmdlinetest.cpp | 8 +- src/testutils/cmdlinetest.h | 14 +-- src/testutils/testfileredirector.h | 12 +-- src/testutils/testinit.cpp | 6 +- src/testutils/testutils-doc.h | 4 +- 74 files changed, 420 insertions(+), 417 deletions(-) rename src/gromacs/onlinehelp/{helptopicinterface.h => ihelptopic.h} (90%) diff --git a/docs/dev-manual/naming.rst b/docs/dev-manual/naming.rst index 987e19a80f..f8bdbc5612 100644 --- a/docs/dev-manual/naming.rst +++ b/docs/dev-manual/naming.rst @@ -87,8 +87,11 @@ C++ code You may use an all-lowercase name with underscores if your class closely resembles an external construct (e.g., a standard library construct) named that way. -* C++ interfaces are named with a ``Interface`` suffix, and abstract base - classes with an ``Abstract`` prefix. +* C++ interfaces are named with an ``I`` prefix, such as in ICommandLineModule. + This keeps interfaces identifiable, without introducing too much clutter + (as the interface is typically used quite widely, spelling out + ``Interface`` would make many of the names unnecessarily long). +* Abstract base classes are typically named with an ``Abstract`` prefix. * Member variables are named with a trailing underscore. * Accessors for a variable ``foo_`` are named ``foo()`` and ``setFoo()``. * Global variables are named with a ``g_`` prefix. diff --git a/docs/dev-manual/relocatable-binaries.rst b/docs/dev-manual/relocatable-binaries.rst index df83d9b37d..e29907d2d1 100644 --- a/docs/dev-manual/relocatable-binaries.rst +++ b/docs/dev-manual/relocatable-binaries.rst @@ -134,7 +134,7 @@ implementation, which works like this: The above logic to find the installation prefix is in ``src/gromacs/commandline/cmdlineprogramcontext.cpp``. Note that code that links to ``libgromacs`` can provide an alternative implementation for -``gmx::ProgramContextInterface`` for locating the data files, and is then fully +``gmx::IProgramContext`` for locating the data files, and is then fully responsible of the above considerations. Information about the used data directories is printed into the console output diff --git a/docs/dev-manual/testutils.rst b/docs/dev-manual/testutils.rst index 3f7ff23536..ba73b398a9 100644 --- a/docs/dev-manual/testutils.rst +++ b/docs/dev-manual/testutils.rst @@ -136,7 +136,7 @@ a few parts: In addition to ``src/testutils/``, some of the module test directories may provide reusable test code that is used in higher-level tests. For example, the ``src/gromacs/analysisdata/tests/`` provides test fixtures, a mock -implementation for gmx::AnalysisDataModuleInterface, and some helper classes +implementation for gmx::IAnalysisDataModule, and some helper classes that are also used in ``src/gromacs/trajectoryanalysis/tests/``. These cases are handled using CMake object libraries that are linked to all the test binaries that need them. diff --git a/docs/doxygen/lib/wrapperbinary.md b/docs/doxygen/lib/wrapperbinary.md index 98f6fcc50d..23f7ba16cb 100644 --- a/docs/doxygen/lib/wrapperbinary.md +++ b/docs/doxygen/lib/wrapperbinary.md @@ -29,14 +29,14 @@ Command line modules ==================== All modules within the wrapper binary are implemented as classes that implement -the gmx::CommandLineModuleInterface interface. There is generally some helper +the gmx::ICommandLineModule interface. There is generally some helper class in between: * General C++ modules typically use gmx::Options for their command-line handling. Instead of each module implementing parsing and help separately - with identical code, they implement gmx::CommandLineOptionsModuleInterface + with identical code, they implement gmx::ICommandLineOptionsModule instead. The framework then provides a bridge class that contains the - common code and wraps gmx::CommandLineOptionsModuleInterface into a - gmx::CommandLineModuleInterface. + common code and wraps gmx::ICommandLineOptionsModule into a + gmx::ICommandLineModule. * For C++ trajectory analysis modules, there is a general implementation for running the gmx::TrajectoryAnalysisModule subclasses in cmdlinerunner.cpp. * For old C-style %main() functions, see \ref section_wrapperbinary_cmain. @@ -75,7 +75,7 @@ line manager throws away all the other arguments before passing control to the module. After the above translations, the internal help module handles all the help -output. All the help is organized into a hierarchy of gmx::HelpTopicInterface +output. All the help is organized into a hierarchy of gmx::IHelpTopic instances. The help module internally creates a root help topic that is printed with `gmx help`. If there are additional words after the `gmx help` command, then those are taken to specify the topic to show in the hierarchy. @@ -83,7 +83,7 @@ command, then those are taken to specify the topic to show in the hierarchy. gmx::CommandLineModuleManager internally creates a help topic for each added module. These topics are shown when `gmx help` _module_ is invoked. They forward the request to the actual module (to -gmx::CommandLineModuleInterface::writeHelp()). +gmx::ICommandLineModule::writeHelp()). In addition to the topics created internally, gmx::CommandLineModuleManager provides methods to add additional help topics. Currently, this is used to @@ -104,7 +104,7 @@ of which targets to use for generating the documentation.. If this option is set, the help module loops through all the modules in the binary, writing help for each into a separate file. The help module writes common headers and footers, and asks the actual module to write the -module-specific content (with gmx::CommandLineModuleInterface::writeHelp(), +module-specific content (with gmx::ICommandLineModule::writeHelp(), using a different help context than for console output). Additionally, a list of all the modules is generated (`gromacs.7` for man diff --git a/docs/doxygen/user/analysisdata.md b/docs/doxygen/user/analysisdata.md index 9347285519..dffc1fac05 100644 --- a/docs/doxygen/user/analysisdata.md +++ b/docs/doxygen/user/analysisdata.md @@ -9,7 +9,7 @@ module is visualized below: digraph analysisdata_overview { rankdir = BT dataobject [label="data object\n(subclass of gmx::AbstractAnalysisData)"] - datamodule1 [label="data module\n(implements gmx::AnalysisDataModuleInterface)"] + datamodule1 [label="data module\n(implements gmx::IAnalysisDataModule)"] datamodule2 [label="data module\nthat also provides data"] datamodule3 [label="data module"] datamodule1 -> dataobject @@ -26,7 +26,7 @@ To perform operations on the data, one or more _data modules_ can be attached to the data object. Examples of such operations are averaging, histogramming, and plotting the data into a file. Some data modules are provided by the \ref module_analysisdata module. To implement new ones, it is necessary to create a -class that implements gmx::AnalysisDataModuleInterface. +class that implements gmx::IAnalysisDataModule. In many cases, such data modules also provide data that can be processed further, acting as data objects themselves. This makes it possible to attach @@ -171,7 +171,7 @@ with a short description. See the documentation of the individual classes for more details. Note that this list is manually maintained, so it may not always be up-to-date. A comprehensive list can be found by looking at the inheritance graph of -gmx::AnalysisDataModuleInterface, but the list here is more user-friendly. +gmx::IAnalysisDataModule, but the list here is more user-friendly.
gmx::AnalysisDataAverageModule
diff --git a/docs/doxygen/user/usinglibrary.md b/docs/doxygen/user/usinglibrary.md index f3498d02a5..099417fde3 100644 --- a/docs/doxygen/user/usinglibrary.md +++ b/docs/doxygen/user/usinglibrary.md @@ -18,11 +18,11 @@ low-level functions. the facilities provided by \ref module_commandline. There are a few different alternatives, depending on how much control you want to give \Gromacs: - - For C++ code, you can implement gmx::CommandLineOptionsModuleInterface and + - For C++ code, you can implement gmx::ICommandLineOptionsModule and use gmx::runCommandLineModule() to execute it. This interface assumes the use of the gmx::Options mechanism for declaring command-line options (see \ref module_options). - For a lower-level interface, gmx::CommandLineModuleInterface can be used, + For a lower-level interface, gmx::ICommandLineModule can be used, but this requires you to implement `-h` output and command-line parsing yourself (possibly using classes that \Gromacs provides). - For C code, you can use gmx_run_cmain() to wrap an existing C main @@ -37,7 +37,7 @@ low-level functions. routines. This allows you to write your own handling for command line options from scratch. This is also discussed in \ref module_commandline. - For most control, you can use gmx::init() to do basic initialization, create - your own implementation for gmx::ProgramContextInterface, and set that using + your own implementation for gmx::IProgramContext, and set that using gmx::setProgramContext(). This allows you to customize how the \Gromacs library shows the name of the program in messages, as well as how it locates its own data files. diff --git a/src/gromacs/analysisdata.h b/src/gromacs/analysisdata.h index 2b0f24601d..ac115b6593 100644 --- a/src/gromacs/analysisdata.h +++ b/src/gromacs/analysisdata.h @@ -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. @@ -54,9 +54,9 @@ * gmx::AnalysisData and gmx::AnalysisArrayData. These classes are used to * process and store raw data as produced by the analysis tool. They also * provide an interface to attach data modules that implement - * gmx::AnalysisDataModuleInterface. + * gmx::IAnalysisDataModule. * - * Modules that implement gmx::AnalysisDataModuleInterface form the second part + * Modules that implement gmx::IAnalysisDataModule form the second part * of the module, and they provide functionality to do processing on the data. * These modules can also derive from gmx::AbstractAnalysisData, allowing other * modules to be attached to them to form a processing chain that best suits @@ -70,7 +70,7 @@ * To use the functionality in this module, you typically declare one or more * AnalysisData objects and set its properties. You then create some module * objects and set their properties (see the list of classes that implement - * gmx::AnalysisDataModuleInterface) and attach them to the data objects or to + * gmx::IAnalysisDataModule) and attach them to the data objects or to * one another using gmx::AbstractAnalysisData::addModule(). Then you add the * actual data values to the gmx::AnalysisData object, which automatically * passes it on to the modules. @@ -87,7 +87,7 @@ * *

Data Modules

* - * Modules that derive from gmx::AnalysisDataModuleInterface can operate in two + * Modules that derive from gmx::IAnalysisDataModule can operate in two * modes: * - In _serial_ mode, the frames are presented to the module always in the * order of increasing indices, even if they become ready in a different @@ -118,22 +118,22 @@ * node [ shape=box ] * * start [ label="dataStarted()", - * URL="\ref gmx::AnalysisDataModuleInterface::dataStarted()" ] + * URL="\ref gmx::IAnalysisDataModule::dataStarted()" ] * pstart [ label="parallelDataStarted()", - * URL="\ref gmx::AnalysisDataModuleInterface::parallelDataStarted()" ] + * URL="\ref gmx::IAnalysisDataModule::parallelDataStarted()" ] * subgraph cluster_frame { * label = "for each frame" * framestart [ label="frameStarted()", - * URL="\ref gmx::AnalysisDataModuleInterface::frameStarted()" ] + * URL="\ref gmx::IAnalysisDataModule::frameStarted()" ] * pointsadd [ label="pointsAdded()", - * URL="\ref gmx::AnalysisDataModuleInterface::pointsAdded()" ] + * URL="\ref gmx::IAnalysisDataModule::pointsAdded()" ] * framefinish [ label="frameFinished()", - * URL="\ref gmx::AnalysisDataModuleInterface::frameFinished()" ] + * URL="\ref gmx::IAnalysisDataModule::frameFinished()" ] * serialfinish [ label="frameFinishedSerial()", - * URL="\ref gmx::AnalysisDataModuleInterface::frameFinishedSerial()" ] + * URL="\ref gmx::IAnalysisDataModule::frameFinishedSerial()" ] * } * finish [ label="dataFinished()", - * URL="\ref gmx::AnalysisDataModuleInterface::dataFinished()" ] + * URL="\ref gmx::IAnalysisDataModule::dataFinished()" ] * * start -> framestart * pstart -> framestart @@ -176,7 +176,7 @@ * * New data modules can be implemented to perform custom operations that are * not supported by the modules provided in this module. This is done by - * creating a new class that implements gmx::AnalysisDataModuleInterface. + * creating a new class that implements gmx::IAnalysisDataModule. * If the new module computes values that can be used as input for other * modules, the new class should also derive from gmx::AbstractAnalysisData, and * preferably use gmx::AnalysisDataStorage internally to implement storage of diff --git a/src/gromacs/analysisdata/abstractdata.cpp b/src/gromacs/analysisdata/abstractdata.cpp index 9d21ccad6c..94e2103893 100644 --- a/src/gromacs/analysisdata/abstractdata.cpp +++ b/src/gromacs/analysisdata/abstractdata.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. @@ -185,7 +185,7 @@ AbstractAnalysisData::addColumnModule(int col, int span, void -AbstractAnalysisData::applyModule(AnalysisDataModuleInterface *module) +AbstractAnalysisData::applyModule(IAnalysisDataModule *module) { impl_->modules_.applyModule(this, module); } diff --git a/src/gromacs/analysisdata/abstractdata.h b/src/gromacs/analysisdata/abstractdata.h index fd1c99db56..ac3a9224d2 100644 --- a/src/gromacs/analysisdata/abstractdata.h +++ b/src/gromacs/analysisdata/abstractdata.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. @@ -50,14 +50,14 @@ namespace gmx { -class AnalysisDataModuleInterface; class AnalysisDataModuleManager; class AnalysisDataFrameHeader; class AnalysisDataFrameRef; class AnalysisDataPointSetRef; +class IAnalysisDataModule; //! Smart pointer for managing a generic analysis data module. -typedef boost::shared_ptr AnalysisDataModulePointer; +typedef boost::shared_ptr AnalysisDataModulePointer; /*! \brief * Abstract base class for all objects that provide data. @@ -318,7 +318,7 @@ class AbstractAnalysisData * storage (addModule() has the same problem if called after data is * started). */ - void applyModule(AnalysisDataModuleInterface *module); + void applyModule(IAnalysisDataModule *module); protected: /*! \cond libapi */ diff --git a/src/gromacs/analysisdata/analysisdata.h b/src/gromacs/analysisdata/analysisdata.h index c04ae18072..7d1b1997ed 100644 --- a/src/gromacs/analysisdata/analysisdata.h +++ b/src/gromacs/analysisdata/analysisdata.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. @@ -151,7 +151,7 @@ class AnalysisData : public AbstractAnalysisData * \throws std::bad_alloc if out of memory. * \throws APIError if any attached data module is not compatible. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::dataStarted(). + * in IAnalysisDataModule::dataStarted(). * * The caller should retain the returned handle (or a copy of it), and * pass it to finishData() after successfully adding all data. @@ -169,7 +169,7 @@ class AnalysisData : public AbstractAnalysisData * * \param[in] frameIndex Index of the frame that has been finished. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::frameFinishedSerial(). + * in IAnalysisDataModule::frameFinishedSerial(). * * This method should be called sequentially for each frame, after data * for that frame has been produced. It is not necessary to call this @@ -183,7 +183,7 @@ class AnalysisData : public AbstractAnalysisData * * \param[in] handle Handle to destroy. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::dataFinished(). + * in IAnalysisDataModule::dataFinished(). * * \p handle must have been obtained from startData() of this object. * The order of the calls with respect to the corresponding startData() @@ -270,7 +270,7 @@ class AnalysisDataHandle * \param[in] dx Error in x for the frame if applicable. * * \throws unspecified Any exception thrown by attached data - * modules in AnalysisDataModuleInterface::frameStarted(). + * modules in IAnalysisDataModule::frameStarted(). * * Each \p index value 0, 1, ..., N (where N is the total number of * frames) should be started exactly once by exactly one handle of an @@ -338,7 +338,7 @@ class AnalysisDataHandle * * \throws APIError if any attached data module is not compatible. * \throws unspecified Any exception thrown by attached data - * modules in AnalysisDataModuleInterface::pointsAdded(). + * modules in IAnalysisDataModule::pointsAdded(). * * Must be called after each point set for multipoint data, including * the last (i.e., no values must be set between the last call to this diff --git a/src/gromacs/analysisdata/datamodule.h b/src/gromacs/analysisdata/datamodule.h index 3fa7e02fdc..255f00a2c5 100644 --- a/src/gromacs/analysisdata/datamodule.h +++ b/src/gromacs/analysisdata/datamodule.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. @@ -34,7 +34,7 @@ */ /*! \file * \brief - * Declares gmx::AnalysisDataModuleInterface and related convenience classes. + * Declares gmx::IAnalysisDataModule and related convenience classes. * * \author Teemu Murtola * \inlibraryapi @@ -78,7 +78,7 @@ class AnalysisDataPointSetRef; * \inlibraryapi * \ingroup module_analysisdata */ -class AnalysisDataModuleInterface +class IAnalysisDataModule { public: /*! \brief @@ -98,7 +98,7 @@ class AnalysisDataModuleInterface efAllowMultipleDataSets = 1<<4 }; - virtual ~AnalysisDataModuleInterface() {}; + virtual ~IAnalysisDataModule() {}; /*! \brief * Returns properties supported by the module. @@ -237,7 +237,7 @@ class AnalysisDataModuleInterface * \inlibraryapi * \ingroup module_analysisdata */ -class AnalysisDataModuleSerial : public AnalysisDataModuleInterface +class AnalysisDataModuleSerial : public IAnalysisDataModule { public: virtual ~AnalysisDataModuleSerial() {} @@ -267,7 +267,7 @@ class AnalysisDataModuleSerial : public AnalysisDataModuleInterface * \inlibraryapi * \ingroup module_analysisdata */ -class AnalysisDataModuleParallel : public AnalysisDataModuleInterface +class AnalysisDataModuleParallel : public IAnalysisDataModule { public: virtual ~AnalysisDataModuleParallel() {} diff --git a/src/gromacs/analysisdata/datamodulemanager.cpp b/src/gromacs/analysisdata/datamodulemanager.cpp index ab10252807..f9e4d8dbb3 100644 --- a/src/gromacs/analysisdata/datamodulemanager.cpp +++ b/src/gromacs/analysisdata/datamodulemanager.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. @@ -104,7 +104,7 @@ class AnalysisDataModuleManager::Impl * \param[in] bSet Value of the property to check against. * \throws APIError if \p module is not compatible with the data. */ - void checkModuleProperty(const AnalysisDataModuleInterface &module, + void checkModuleProperty(const IAnalysisDataModule &module, DataProperty property, bool bSet) const; /*! \brief * Checks whether a module is compatible with the data properties. @@ -115,7 +115,7 @@ class AnalysisDataModuleManager::Impl * Does not currently check the actual data (e.g., missing values), but * only the dimensionality and other preset properties of the data. */ - void checkModuleProperties(const AnalysisDataModuleInterface &module) const; + void checkModuleProperties(const IAnalysisDataModule &module) const; /*! \brief * Present data already added to the data object to a module. @@ -133,7 +133,7 @@ class AnalysisDataModuleManager::Impl * been registered to the data object when the data was added. */ void presentData(AbstractAnalysisData *data, - AnalysisDataModuleInterface *module); + IAnalysisDataModule *module); //! List of modules added to the data. ModuleList modules_; @@ -175,7 +175,7 @@ AnalysisDataModuleManager::Impl::Impl() void AnalysisDataModuleManager::Impl::checkModuleProperty( - const AnalysisDataModuleInterface &module, + const IAnalysisDataModule &module, DataProperty property, bool bSet) const { bool bOk = true; @@ -183,20 +183,20 @@ AnalysisDataModuleManager::Impl::checkModuleProperty( switch (property) { case eMultipleDataSets: - if (bSet && !(flags & AnalysisDataModuleInterface::efAllowMultipleDataSets)) + if (bSet && !(flags & IAnalysisDataModule::efAllowMultipleDataSets)) { bOk = false; } break; case eMultipleColumns: - if (bSet && !(flags & AnalysisDataModuleInterface::efAllowMulticolumn)) + if (bSet && !(flags & IAnalysisDataModule::efAllowMulticolumn)) { bOk = false; } break; case eMultipoint: - if ((bSet && !(flags & AnalysisDataModuleInterface::efAllowMultipoint)) - || (!bSet && (flags & AnalysisDataModuleInterface::efOnlyMultipoint))) + if ((bSet && !(flags & IAnalysisDataModule::efAllowMultipoint)) + || (!bSet && (flags & IAnalysisDataModule::efOnlyMultipoint))) { bOk = false; } @@ -212,7 +212,7 @@ AnalysisDataModuleManager::Impl::checkModuleProperty( void AnalysisDataModuleManager::Impl::checkModuleProperties( - const AnalysisDataModuleInterface &module) const + const IAnalysisDataModule &module) const { for (int i = 0; i < eDataPropertyNR; ++i) { @@ -221,8 +221,8 @@ AnalysisDataModuleManager::Impl::checkModuleProperties( } void -AnalysisDataModuleManager::Impl::presentData(AbstractAnalysisData *data, - AnalysisDataModuleInterface *module) +AnalysisDataModuleManager::Impl::presentData(AbstractAnalysisData *data, + IAnalysisDataModule *module) { if (state_ == eNotStarted) { @@ -232,7 +232,7 @@ AnalysisDataModuleManager::Impl::presentData(AbstractAnalysisData *data, "Cannot apply a modules in mid-frame"); module->dataStarted(data); const bool bCheckMissing = bAllowMissing_ - && !(module->flags() & AnalysisDataModuleInterface::efAllowMissing); + && !(module->flags() & IAnalysisDataModule::efAllowMissing); for (int i = 0; i < data->frameCount(); ++i) { AnalysisDataFrameRef frame = data->getDataFrame(i); @@ -298,7 +298,7 @@ AnalysisDataModuleManager::addModule(AbstractAnalysisData *data, "Cannot add a data module in mid-frame"); impl_->presentData(data, module.get()); - if (!(module->flags() & AnalysisDataModuleInterface::efAllowMissing)) + if (!(module->flags() & IAnalysisDataModule::efAllowMissing)) { impl_->bAllowMissing_ = false; } @@ -306,8 +306,8 @@ AnalysisDataModuleManager::addModule(AbstractAnalysisData *data, } void -AnalysisDataModuleManager::applyModule(AbstractAnalysisData *data, - AnalysisDataModuleInterface *module) +AnalysisDataModuleManager::applyModule(AbstractAnalysisData *data, + IAnalysisDataModule *module) { impl_->checkModuleProperties(*module); GMX_RELEASE_ASSERT(impl_->state_ == Impl::eFinished, diff --git a/src/gromacs/analysisdata/datamodulemanager.h b/src/gromacs/analysisdata/datamodulemanager.h index 65c1594316..2bc9bdb64b 100644 --- a/src/gromacs/analysisdata/datamodulemanager.h +++ b/src/gromacs/analysisdata/datamodulemanager.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. @@ -54,7 +54,7 @@ class AnalysisDataParallelOptions; /*! \libinternal \brief * Encapsulates handling of data modules attached to AbstractAnalysisData. * - * See AnalysisDataModuleInterface and \ref module_analysisdata for more + * See IAnalysisDataModule and \ref module_analysisdata for more * details on the notifications and the order in which they should be raised. * * \inlibraryapi @@ -66,7 +66,7 @@ class AnalysisDataModuleManager /*! \brief * Identifies data properties to check with data modules. * - * \see AnalysisDataModuleInterface::Flag + * \see IAnalysisDataModule::Flag */ enum DataProperty { @@ -132,8 +132,8 @@ class AnalysisDataModuleManager * * \see AbstractAnalysisData::applyModule() */ - void applyModule(AbstractAnalysisData *data, - AnalysisDataModuleInterface *module); + void applyModule(AbstractAnalysisData *data, + IAnalysisDataModule *module); /*! \brief * Notifies attached modules of the start of serial data. @@ -141,7 +141,7 @@ class AnalysisDataModuleManager * \param data Data object that is starting. * \throws APIError if any attached data module is not compatible. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::dataStarted(). + * in IAnalysisDataModule::dataStarted(). * * Should be called once, after data properties have been set with * the methods in AbstractAnalysisData, and before any other @@ -153,7 +153,7 @@ class AnalysisDataModuleManager * derived from AbstractAnalysisData. * * This method initializes all modules for serial processing by calling - * AnalysisDataModuleInterface::dataStarted(). + * IAnalysisDataModule::dataStarted(). */ void notifyDataStart(AbstractAnalysisData *data); /*! \brief @@ -163,11 +163,11 @@ class AnalysisDataModuleManager * \param[in] options Parallelization properties of the input data. * \throws APIError if any attached data module is not compatible. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::parallelDataStarted(). + * in IAnalysisDataModule::parallelDataStarted(). * * Can be called instead of notifyDataStart() if \p data supports * non-sequential creation of frames. Works as notifyDataStart(), - * but instead calls AnalysisDataModuleInterface::parallelDataStarted() + * but instead calls IAnalysisDataModule::parallelDataStarted() * and records whether the module supports the parallel mode. * Subsequent notification calls then notify the modules according to * the mode they accept. @@ -182,7 +182,7 @@ class AnalysisDataModuleManager * * \param[in] header Header information for the frame that is starting. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::frameStarted(). + * in IAnalysisDataModule::frameStarted(). * * Should be called once for each frame, before notifyPointsAdd() calls * for that frame. @@ -193,7 +193,7 @@ class AnalysisDataModuleManager * * \param[in] header Header information for the frame that is starting. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::frameStarted(). + * in IAnalysisDataModule::frameStarted(). * * If notifyParallelDataStart() has been called, should be called once * for each frame, before notifyParallelPointsAdd() calls for that @@ -210,7 +210,7 @@ class AnalysisDataModuleManager * frame-level data). * \throws APIError if any attached data module is not compatible. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::pointsAdded(). + * in IAnalysisDataModule::pointsAdded(). * * Can be called zero or more times for each frame. * The caller should ensure that any column occurs at most once in the @@ -228,7 +228,7 @@ class AnalysisDataModuleManager * frame-level data). * \throws APIError if any attached data module is not compatible. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::pointsAdded(). + * in IAnalysisDataModule::pointsAdded(). * * See notifyPointsAdd() for information on the structure of the point * sets. @@ -239,7 +239,7 @@ class AnalysisDataModuleManager * * \param[in] header Header information for the frame that is ending. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::frameFinished(). + * in IAnalysisDataModule::frameFinished(). * * Should be called once for each call of notifyFrameStart(), after any * notifyPointsAdd() calls for the frame. @@ -254,7 +254,7 @@ class AnalysisDataModuleManager * * \param[in] header Header information for the frame that is ending. * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::frameFinished(). + * in IAnalysisDataModule::frameFinished(). * * Should be called once for each call of notifyParallelFrameStart(), * after any notifyParallelPointsAdd() calls for the frame. @@ -266,7 +266,7 @@ class AnalysisDataModuleManager * Notifies attached modules of the end of data. * * \throws unspecified Any exception thrown by attached data modules - * in AnalysisDataModuleInterface::dataFinished(). + * in IAnalysisDataModule::dataFinished(). * * Should be called once, after all the other notification calls. */ diff --git a/src/gromacs/analysisdata/dataproxy.h b/src/gromacs/analysisdata/dataproxy.h index 72e6c852ce..1b8f639a02 100644 --- a/src/gromacs/analysisdata/dataproxy.h +++ b/src/gromacs/analysisdata/dataproxy.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. @@ -56,16 +56,16 @@ namespace gmx * Internal implementation class used to implement column modules. * * This class serves as a proxy between AbstractAnalysisData and the attached - * AnalysisDataModuleInterface object. For each notification that + * IAnalysisDataModule object. For each notification that * AbstractAnalysisData sends, it maps it such that only the relevant columns - * are visible to the AnalysisDataModuleInterface. Similarly, it implements + * are visible to the IAnalysisDataModule. Similarly, it implements * the frame access methods of AbstractAnalysisData such that only the relevant * columns are returned. * * \ingroup module_analysisdata */ class AnalysisDataProxy : public AbstractAnalysisData, - public AnalysisDataModuleInterface + public IAnalysisDataModule { public: /*! \brief diff --git a/src/gromacs/analysisdata/framelocaldata.h b/src/gromacs/analysisdata/framelocaldata.h index f6fa5ca3a7..99fb08c6ac 100644 --- a/src/gromacs/analysisdata/framelocaldata.h +++ b/src/gromacs/analysisdata/framelocaldata.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -165,7 +165,7 @@ class AnalysisDataFrameLocalDataHandle * data for use in analysis data modules that support parallel processing. * The object is initialized by setting the desired dimensionality with * setDataSetCount() and setColumnCount(), followed by a call to init(), - * typically in AnalysisDataModuleInterface::parallelDataStarted(), + * typically in IAnalysisDataModule::parallelDataStarted(), * * After initialization, frameData() can be used to access the data for a given * frame, independently from other frames. This works if the assumptions about @@ -180,7 +180,7 @@ class AnalysisDataFrameLocalDataHandle * over all frames in a lock-free manner. * * frameDataSet() is provided for convenience when only a single data set - * needs to be accessed (typically in AnalysisDataModuleInterface::pointsAdded()). + * needs to be accessed (typically in IAnalysisDataModule::pointsAdded()). * * Methods in this class do not throw except where indicated. * diff --git a/src/gromacs/analysisdata/modules/frameaverager.h b/src/gromacs/analysisdata/modules/frameaverager.h index 61867c24c4..58604f04fe 100644 --- a/src/gromacs/analysisdata/modules/frameaverager.h +++ b/src/gromacs/analysisdata/modules/frameaverager.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -87,7 +87,7 @@ class AnalysisDataFrameAverager * * \throws std::bad_alloc if out of memory. * - * Typically called from AnalysisDataModuleInterface::dataStarted(). + * Typically called from IAnalysisDataModule::dataStarted(). * * Must be called exactly once, before setting calling any other method * in the class. @@ -103,7 +103,7 @@ class AnalysisDataFrameAverager /*! \brief * Accumulates data from a given point set into the average. * - * Typically called from AnalysisDataModuleInterface::pointsAdded(). + * Typically called from IAnalysisDataModule::pointsAdded(). * * Each call accumulates the values for those columns that are present * in the point set. Can be called multiple times for a frame, and @@ -117,7 +117,7 @@ class AnalysisDataFrameAverager * addPoints(). Currently, does nothing, but provided as a placeholder * for more complex implementation. * - * Typically called from AnalysisDataModuleInterface::dataFinished(). + * Typically called from IAnalysisDataModule::dataFinished(). */ void finish(); diff --git a/src/gromacs/analysisdata/tests/analysisdata.cpp b/src/gromacs/analysisdata/tests/analysisdata.cpp index 4332f27641..4f4eb296cd 100644 --- a/src/gromacs/analysisdata/tests/analysisdata.cpp +++ b/src/gromacs/analysisdata/tests/analysisdata.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -40,7 +40,7 @@ * used in its implementation: gmx::AbstractAnalysisData and * gmx::AnalysisDataStorage. * Most checking is done using gmx::test::AnalysisDataTestFixture and mock - * modules that implement gmx::AnalysisDataModuleInterface. + * modules that implement gmx::IAnalysisDataModule. * * \author Teemu Murtola * \ingroup module_analysisdata @@ -120,7 +120,7 @@ TEST(AnalysisDataInitializationTest, ChecksMultiColumnModules) EXPECT_THROW_GMX(data.addModule(mod1), gmx::APIError); MockAnalysisDataModulePointer mod2( - new MockAnalysisDataModule(gmx::AnalysisDataModuleInterface::efAllowMulticolumn)); + new MockAnalysisDataModule(gmx::IAnalysisDataModule::efAllowMulticolumn)); EXPECT_NO_THROW_GMX(data.addModule(mod2)); } @@ -138,7 +138,7 @@ TEST(AnalysisDataInitializationTest, ChecksMultipointModules) EXPECT_THROW_GMX(data.addModule(mod1), gmx::APIError); MockAnalysisDataModulePointer mod2( - new MockAnalysisDataModule(gmx::AnalysisDataModuleInterface::efAllowMultipoint)); + new MockAnalysisDataModule(gmx::IAnalysisDataModule::efAllowMultipoint)); EXPECT_NO_THROW_GMX(data.addModule(mod2)); } diff --git a/src/gromacs/analysisdata/tests/arraydata.cpp b/src/gromacs/analysisdata/tests/arraydata.cpp index a1d2755bf4..daab8ff38a 100644 --- a/src/gromacs/analysisdata/tests/arraydata.cpp +++ b/src/gromacs/analysisdata/tests/arraydata.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. @@ -39,7 +39,7 @@ * These tests check the functionality of gmx::AnalysisArrayData and its base * class gmx::AbstractAnalysisArrayData. * Checking is done using gmx::test::AnalysisDataTestFixture and mock - * modules that implement gmx::AnalysisDataModuleInterface. + * modules that implement gmx::IAnalysisDataModule. * * \author Teemu Murtola * \ingroup module_analysisdata diff --git a/src/gromacs/analysisdata/tests/datatest.h b/src/gromacs/analysisdata/tests/datatest.h index 6d85dd6b05..ebdbf16152 100644 --- a/src/gromacs/analysisdata/tests/datatest.h +++ b/src/gromacs/analysisdata/tests/datatest.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -343,7 +343,7 @@ class AnalysisDataTestFixture : public ::testing::Test * \param source Data object to verify. * * Creates a mock module that verifies that the - * AnalysisDataModuleInterface methods are called correctly by + * IAnalysisDataModule methods are called correctly by * \p source. Parameters for the calls are verified against \p data. * Adds the created module to \p source using \p data->addModule(). * Any exceptions from the called functions should be caught by the @@ -361,7 +361,7 @@ class AnalysisDataTestFixture : public ::testing::Test * \param source Data object to verify. * * Creates a parallel mock module that verifies that the - * AnalysisDataModuleInterface methods are called correctly by + * IAnalysisDataModule methods are called correctly by * \p source. Parameters for the calls are verified against \p data. * Adds the created module to \p source using \p data->addModule(). * Any exceptions from the called functions should be caught by the @@ -386,7 +386,7 @@ class AnalysisDataTestFixture : public ::testing::Test * \param source Data object to verify. * * Creates a mock module that verifies that the - * AnalysisDataModuleInterface methods are called correctly by + * IAnalysisDataModule methods are called correctly by * \p source. Parameters for the calls are verified against \p data. * Adds the created module to \p source using * \p data->addColumnModule(). @@ -410,7 +410,7 @@ class AnalysisDataTestFixture : public ::testing::Test * Works like addStaticCheckerModule(), except that in addition, for * each frame, the mock module also checks that previous frames can be * accessed using AbstractAnalysisData::getDataFrame(). In the - * AnalysisDataModuleInterface::dataStarted() callback, the mock module + * IAnalysisDataModule::dataStarted() callback, the mock module * calls AbstractAnalysisData::requestStorage() with \p storageCount as * the parameter. */ @@ -426,7 +426,7 @@ class AnalysisDataTestFixture : public ::testing::Test * \param[in] tolerance Tolerance to use for comparison. * * Creates a mock module that verifies that the - * AnalysisDataModuleInterface methods are called correctly by + * IAnalysisDataModule methods are called correctly by * \p source. Parameters for the calls are verified against reference * data using a child compound \p id of \p checker. * Adds the created module to \p source using \p data->addModule(). diff --git a/src/gromacs/analysisdata/tests/mock_datamodule.cpp b/src/gromacs/analysisdata/tests/mock_datamodule.cpp index cdd1ec5490..e1e917e4d6 100644 --- a/src/gromacs/analysisdata/tests/mock_datamodule.cpp +++ b/src/gromacs/analysisdata/tests/mock_datamodule.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -304,7 +304,7 @@ void checkFrame(const AnalysisDataFrameRef &frame, * Functor for checking data frame header against static test input data. * * This functor is designed to be invoked as a handled for - * AnalysisDataModuleInterface::frameStarted(). + * IAnalysisDataModule::frameStarted(). */ class StaticDataFrameHeaderChecker { @@ -336,7 +336,7 @@ class StaticDataFrameHeaderChecker * Functor for checking data frame points against static test input data. * * This functor is designed to be invoked as a handled for - * AnalysisDataModuleInterface::pointsAdded(). + * IAnalysisDataModule::pointsAdded(). */ class StaticDataPointsChecker { @@ -387,7 +387,7 @@ class StaticDataPointsChecker * Functor for requesting data storage. * * This functor is designed to be invoked as a handled for - * AnalysisDataModuleInterface::dataStarted(). + * IAnalysisDataModule::dataStarted(). */ class DataStorageRequester { @@ -417,7 +417,7 @@ class DataStorageRequester * data. * * This functor is designed to be invoked as a handled for - * AnalysisDataModuleInterface::pointsAdded(). + * IAnalysisDataModule::pointsAdded(). */ class StaticDataPointsStorageChecker { diff --git a/src/gromacs/analysisdata/tests/mock_datamodule.h b/src/gromacs/analysisdata/tests/mock_datamodule.h index ebb4baa2f8..584804fac2 100644 --- a/src/gromacs/analysisdata/tests/mock_datamodule.h +++ b/src/gromacs/analysisdata/tests/mock_datamodule.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -34,7 +34,7 @@ */ /*! \libinternal \file * \brief - * Declares mock implementation of gmx::AnalysisDataModuleInterface. + * Declares mock implementation of gmx::IAnalysisDataModule. * * Requires Google Mock. * @@ -61,7 +61,7 @@ namespace test class AnalysisDataTestInput; class TestReferenceChecker; -class MockAnalysisDataModule : public AnalysisDataModuleInterface +class MockAnalysisDataModule : public IAnalysisDataModule { public: explicit MockAnalysisDataModule(int flags); diff --git a/src/gromacs/commandline.h b/src/gromacs/commandline.h index 2b1c2df26f..4032c29882 100644 --- a/src/gromacs/commandline.h +++ b/src/gromacs/commandline.h @@ -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. @@ -47,8 +47,8 @@ * - Helper classes/functions for implementing the %main() function. * See \ref page_usinglibrary for an overview of those available for user * programs. These are declared in cmdlineinit.h - * (gmx::CommandLineModuleInterface is declared in cmdlinemodule.h and - * gmx::CommandLineOptionsInterface in cmdlineoptionsmodule.h). + * (gmx::ICommandLineModule is declared in cmdlinemodule.h and + * gmx::ICommandLineOptions in cmdlineoptionsmodule.h). * \if libapi * * Additionally, for internal \Gromacs use, gmx::CommandLineModuleManager diff --git a/src/gromacs/commandline/cmdlinehelpmodule.cpp b/src/gromacs/commandline/cmdlinehelpmodule.cpp index 3d0020d3cd..11237e21ff 100644 --- a/src/gromacs/commandline/cmdlinehelpmodule.cpp +++ b/src/gromacs/commandline/cmdlinehelpmodule.cpp @@ -77,7 +77,7 @@ namespace gmx namespace { -class HelpExportInterface; +class IHelpExport; class RootHelpTopic; } // namespace @@ -88,24 +88,24 @@ class RootHelpTopic; class CommandLineHelpModuleImpl { public: - CommandLineHelpModuleImpl(const ProgramContextInterface &programContext, + CommandLineHelpModuleImpl(const IProgramContext &programContext, const std::string &binaryName, const CommandLineModuleMap &modules, const CommandLineModuleGroupList &groups); - void exportHelp(HelpExportInterface *exporter); + void exportHelp(IHelpExport *exporter); boost::scoped_ptr rootTopic_; - const ProgramContextInterface &programContext_; + const IProgramContext &programContext_; std::string binaryName_; const CommandLineModuleMap &modules_; const CommandLineModuleGroupList &groups_; CommandLineHelpContext *context_; - const CommandLineModuleInterface *moduleOverride_; + const ICommandLineModule *moduleOverride_; bool bHidden_; - FileOutputRedirectorInterface *outputRedirector_; + IFileOutputRedirector *outputRedirector_; GMX_DISALLOW_COPY_AND_ASSIGN(CommandLineHelpModuleImpl); }; @@ -114,7 +114,7 @@ namespace { /******************************************************************** - * HelpExportInterface + * IHelpExport */ /*! \brief @@ -122,13 +122,13 @@ namespace * * \ingroup module_commandline */ -class HelpExportInterface +class IHelpExport { public: //! Shorthand for a list of modules contained in a group. typedef CommandLineModuleGroupData::ModuleList ModuleGroupContents; - virtual ~HelpExportInterface() {}; + virtual ~IHelpExport() {}; /*! \brief * Called once before exporting individual modules. @@ -146,7 +146,7 @@ class HelpExportInterface * \param[in] displayName Display name for the module (gmx something). */ virtual void exportModuleHelp( - const CommandLineModuleInterface &module, + const ICommandLineModule &module, const std::string &tag, const std::string &displayName) = 0; /*! \brief @@ -184,7 +184,7 @@ class HelpExportInterface * * \param[in] topic Topic to export. */ - virtual void exportTopic(const HelpTopicInterface &topic) = 0; + virtual void exportTopic(const IHelpTopic &topic) = 0; }; /******************************************************************** @@ -241,7 +241,7 @@ class RootHelpTopic : public AbstractCompositeHelpTopic addSubTopic(move(topic)); } //! Exports all the top-level topics with the given exporter. - void exportHelp(HelpExportInterface *exporter); + void exportHelp(IHelpExport *exporter); virtual void writeHelp(const HelpWriterContext &context) const; @@ -256,14 +256,14 @@ class RootHelpTopic : public AbstractCompositeHelpTopic GMX_DISALLOW_COPY_AND_ASSIGN(RootHelpTopic); }; -void RootHelpTopic::exportHelp(HelpExportInterface *exporter) +void RootHelpTopic::exportHelp(IHelpExport *exporter) { std::vector::const_iterator topicName; for (topicName = exportedTopics_.begin(); topicName != exportedTopics_.end(); ++topicName) { - const HelpTopicInterface *topic = findSubTopic(topicName->c_str()); + const IHelpTopic *topic = findSubTopic(topicName->c_str()); GMX_RELEASE_ASSERT(topic != NULL, "Exported help topic no longer found"); exporter->exportTopic(*topic); } @@ -327,7 +327,7 @@ void RootHelpTopic::writeHelp(const HelpWriterContext &context) const * * \ingroup module_commandline */ -class CommandsHelpTopic : public HelpTopicInterface +class CommandsHelpTopic : public IHelpTopic { public: /*! \brief @@ -345,7 +345,7 @@ class CommandsHelpTopic : public HelpTopicInterface virtual const char *name() const { return "commands"; } virtual const char *title() const { return "List of available commands"; } virtual bool hasSubTopics() const { return false; } - virtual const HelpTopicInterface *findSubTopic(const char * /*name*/) const + virtual const IHelpTopic *findSubTopic(const char * /*name*/) const { return NULL; } @@ -408,17 +408,17 @@ void CommandsHelpTopic::writeHelp(const HelpWriterContext &context) const /*! \brief * Help topic wrapper for a command-line module. * - * This class implements HelpTopicInterface such that it wraps a - * CommandLineModuleInterface, allowing subcommand "help " + * This class implements IHelpTopic such that it wraps a + * ICommandLineModule, allowing subcommand "help " * to produce the help for "". * * \ingroup module_commandline */ -class ModuleHelpTopic : public HelpTopicInterface +class ModuleHelpTopic : public IHelpTopic { public: //! Constructs a help topic for a specific module. - ModuleHelpTopic(const CommandLineModuleInterface &module, + ModuleHelpTopic(const ICommandLineModule &module, const CommandLineHelpModuleImpl &helpModule) : module_(module), helpModule_(helpModule) { @@ -427,14 +427,14 @@ class ModuleHelpTopic : public HelpTopicInterface virtual const char *name() const { return module_.name(); } virtual const char *title() const { return NULL; } virtual bool hasSubTopics() const { return false; } - virtual const HelpTopicInterface *findSubTopic(const char * /*name*/) const + virtual const IHelpTopic *findSubTopic(const char * /*name*/) const { return NULL; } virtual void writeHelp(const HelpWriterContext &context) const; private: - const CommandLineModuleInterface &module_; + const ICommandLineModule &module_; const CommandLineHelpModuleImpl &helpModule_; GMX_DISALLOW_COPY_AND_ASSIGN(ModuleHelpTopic); @@ -490,17 +490,17 @@ void initProgramLinks(HelpLinks *links, const CommandLineHelpModuleImpl &helpMod * * \ingroup module_commandline */ -class HelpExportReStructuredText : public HelpExportInterface +class HelpExportReStructuredText : public IHelpExport { public: //! Initializes reST exporter. HelpExportReStructuredText( const CommandLineHelpModuleImpl &helpModule, - FileOutputRedirectorInterface *outputRedirector); + IFileOutputRedirector *outputRedirector); virtual void startModuleExport(); virtual void exportModuleHelp( - const CommandLineModuleInterface &module, + const ICommandLineModule &module, const std::string &tag, const std::string &displayName); virtual void finishModuleExport(); @@ -510,10 +510,10 @@ class HelpExportReStructuredText : public HelpExportInterface const ModuleGroupContents &modules); virtual void finishModuleGroupExport(); - virtual void exportTopic(const HelpTopicInterface &topic); + virtual void exportTopic(const IHelpTopic &topic); private: - FileOutputRedirectorInterface *outputRedirector_; + IFileOutputRedirector *outputRedirector_; const std::string &binaryName_; HelpLinks links_; boost::scoped_ptr indexFile_; @@ -522,7 +522,7 @@ class HelpExportReStructuredText : public HelpExportInterface HelpExportReStructuredText::HelpExportReStructuredText( const CommandLineHelpModuleImpl &helpModule, - FileOutputRedirectorInterface *outputRedirector) + IFileOutputRedirector *outputRedirector) : outputRedirector_(outputRedirector), binaryName_(helpModule.binaryName_), links_(eHelpOutputFormat_Rst) @@ -555,7 +555,7 @@ void HelpExportReStructuredText::startModuleExport() } void HelpExportReStructuredText::exportModuleHelp( - const CommandLineModuleInterface &module, + const ICommandLineModule &module, const std::string &tag, const std::string &displayName) { @@ -658,7 +658,7 @@ void HelpExportReStructuredText::finishModuleGroupExport() manPagesFile_.reset(); } -void HelpExportReStructuredText::exportTopic(const HelpTopicInterface &topic) +void HelpExportReStructuredText::exportTopic(const IHelpTopic &topic) { const std::string path("onlinehelp/" + std::string(topic.name()) + ".rst"); TextOutputStreamPointer file(outputRedirector_->openTextOutputFile(path)); @@ -678,7 +678,7 @@ void HelpExportReStructuredText::exportTopic(const HelpTopicInterface &topic) * * \ingroup module_commandline */ -class HelpExportCompletion : public HelpExportInterface +class HelpExportCompletion : public IHelpExport { public: //! Initializes completion exporter. @@ -686,7 +686,7 @@ class HelpExportCompletion : public HelpExportInterface virtual void startModuleExport(); virtual void exportModuleHelp( - const CommandLineModuleInterface &module, + const ICommandLineModule &module, const std::string &tag, const std::string &displayName); virtual void finishModuleExport(); @@ -696,7 +696,7 @@ class HelpExportCompletion : public HelpExportInterface const ModuleGroupContents & /*modules*/) {} virtual void finishModuleGroupExport() {} - virtual void exportTopic(const HelpTopicInterface & /*topic*/) {} + virtual void exportTopic(const IHelpTopic & /*topic*/) {} private: ShellCompletionWriter bashWriter_; @@ -715,7 +715,7 @@ void HelpExportCompletion::startModuleExport() } void HelpExportCompletion::exportModuleHelp( - const CommandLineModuleInterface &module, + const ICommandLineModule &module, const std::string & /*tag*/, const std::string & /*displayName*/) { @@ -744,7 +744,7 @@ void HelpExportCompletion::finishModuleExport() */ CommandLineHelpModuleImpl::CommandLineHelpModuleImpl( - const ProgramContextInterface &programContext, + const IProgramContext &programContext, const std::string &binaryName, const CommandLineModuleMap &modules, const CommandLineModuleGroupList &groups) @@ -755,7 +755,7 @@ CommandLineHelpModuleImpl::CommandLineHelpModuleImpl( { } -void CommandLineHelpModuleImpl::exportHelp(HelpExportInterface *exporter) +void CommandLineHelpModuleImpl::exportHelp(IHelpExport *exporter) { // TODO: Would be nicer to have the file names supplied by the build system // and/or export a list of files from here. @@ -798,7 +798,7 @@ class ModificationCheckingFileOutputStream : public TextOutputStream public: ModificationCheckingFileOutputStream( const char *path, - FileOutputRedirectorInterface *redirector) + IFileOutputRedirector *redirector) : path_(path), redirector_(redirector) { } @@ -824,18 +824,18 @@ class ModificationCheckingFileOutputStream : public TextOutputStream private: std::string path_; StringOutputStream contents_; - FileOutputRedirectorInterface *redirector_; + IFileOutputRedirector *redirector_; }; /******************************************************************** * ModificationCheckingFileOutputRedirector */ -class ModificationCheckingFileOutputRedirector : public FileOutputRedirectorInterface +class ModificationCheckingFileOutputRedirector : public IFileOutputRedirector { public: explicit ModificationCheckingFileOutputRedirector( - FileOutputRedirectorInterface *redirector) + IFileOutputRedirector *redirector) : redirector_(redirector) { } @@ -851,7 +851,7 @@ class ModificationCheckingFileOutputRedirector : public FileOutputRedirectorInte } private: - FileOutputRedirectorInterface *redirector_; + IFileOutputRedirector *redirector_; }; } // namespace @@ -861,7 +861,7 @@ class ModificationCheckingFileOutputRedirector : public FileOutputRedirectorInte */ CommandLineHelpModule::CommandLineHelpModule( - const ProgramContextInterface &programContext, + const IProgramContext &programContext, const std::string &binaryName, const CommandLineModuleMap &modules, const CommandLineModuleGroupList &groups) @@ -874,7 +874,7 @@ CommandLineHelpModule::~CommandLineHelpModule() } HelpTopicPointer CommandLineHelpModule::createModuleHelpTopic( - const CommandLineModuleInterface &module) const + const ICommandLineModule &module) const { return HelpTopicPointer(new ModuleHelpTopic(module, *impl_)); } @@ -890,13 +890,13 @@ void CommandLineHelpModule::setShowHidden(bool bHidden) } void CommandLineHelpModule::setModuleOverride( - const CommandLineModuleInterface &module) + const ICommandLineModule &module) { impl_->moduleOverride_ = &module; } void CommandLineHelpModule::setOutputRedirector( - FileOutputRedirectorInterface *output) + IFileOutputRedirector *output) { impl_->outputRedirector_ = output; } @@ -915,7 +915,7 @@ int CommandLineHelpModule::run(int argc, char *argv[]) if (!exportFormat.empty()) { ModificationCheckingFileOutputRedirector redirector(impl_->outputRedirector_); - boost::scoped_ptr exporter; + boost::scoped_ptr exporter; if (exportFormat == "rst") { exporter.reset(new HelpExportReStructuredText(*impl_, &redirector)); diff --git a/src/gromacs/commandline/cmdlinehelpmodule.h b/src/gromacs/commandline/cmdlinehelpmodule.h index 87214a2c01..73cc444360 100644 --- a/src/gromacs/commandline/cmdlinehelpmodule.h +++ b/src/gromacs/commandline/cmdlinehelpmodule.h @@ -43,7 +43,7 @@ #define GMX_COMMANDLINE_CMDLINEHELPMODULE_H #include "gromacs/commandline/cmdlinemodule.h" -#include "gromacs/onlinehelp/helptopicinterface.h" +#include "gromacs/onlinehelp/ihelptopic.h" #include "gromacs/utility/classhelpers.h" #include "cmdlinemodulemanager-impl.h" @@ -52,8 +52,8 @@ namespace gmx { class CommandLineHelpContext; -class FileOutputRedirectorInterface; -class ProgramContextInterface; +class IFileOutputRedirector; +class IProgramContext; class CommandLineHelpModuleImpl; @@ -66,7 +66,7 @@ class CommandLineHelpModuleImpl; * * \ingroup module_commandline */ -class CommandLineHelpModule : public CommandLineModuleInterface +class CommandLineHelpModule : public ICommandLineModule { public: /*! \brief @@ -79,7 +79,7 @@ class CommandLineHelpModule : public CommandLineModuleInterface * \param[in] groups List of module groups. * \throws std::bad_alloc if out of memory. */ - CommandLineHelpModule(const ProgramContextInterface &programContext, + CommandLineHelpModule(const IProgramContext &programContext, const std::string &binaryName, const CommandLineModuleMap &modules, const CommandLineModuleGroupList &groups); @@ -96,7 +96,7 @@ class CommandLineHelpModule : public CommandLineModuleInterface * safety in CommandLineModuleManager::addModule(). */ HelpTopicPointer - createModuleHelpTopic(const CommandLineModuleInterface &module) const; + createModuleHelpTopic(const ICommandLineModule &module) const; /*! \brief * Adds a top-level help topic. * @@ -114,7 +114,7 @@ class CommandLineHelpModule : public CommandLineModuleInterface * If called, the help module directly prints the help for the given * module when called, skipping any other processing. */ - void setModuleOverride(const CommandLineModuleInterface &module); + void setModuleOverride(const ICommandLineModule &module); /*! \brief * Sets a file redirector for writing help output. @@ -122,7 +122,7 @@ class CommandLineHelpModule : public CommandLineModuleInterface * Used for unit testing; see * CommandLineModuleManager::setOutputRedirector() for more details. */ - void setOutputRedirector(FileOutputRedirectorInterface *output); + void setOutputRedirector(IFileOutputRedirector *output); virtual const char *name() const { return "help"; } virtual const char *shortDescription() const diff --git a/src/gromacs/commandline/cmdlinehelpwriter.cpp b/src/gromacs/commandline/cmdlinehelpwriter.cpp index 1241c66755..69448c4bd7 100644 --- a/src/gromacs/commandline/cmdlinehelpwriter.cpp +++ b/src/gromacs/commandline/cmdlinehelpwriter.cpp @@ -137,7 +137,7 @@ void DescriptionsFormatter::visitSubSection(const Options §ion) } /******************************************************************** - * OptionsFormatterInterface + * IOptionsFormatter */ /*! \brief @@ -145,10 +145,10 @@ void DescriptionsFormatter::visitSubSection(const Options §ion) * * \see OptionsFilter */ -class OptionsFormatterInterface +class IOptionsFormatter { public: - virtual ~OptionsFormatterInterface() {} + virtual ~IOptionsFormatter() {} //! Formats a single option option. virtual void formatOption(const OptionInfo &option) = 0; @@ -163,7 +163,7 @@ class OptionsFormatterInterface * * Together with code in CommandLineHelpWriter::writeHelp(), this class * implements the common logic for writing out the help. - * An object implementing the OptionsFormatterInterface must be provided to the + * An object implementing the IOptionsFormatter must be provided to the * constructor, and does the actual formatting that is specific to the output * format. */ @@ -198,14 +198,14 @@ class OptionsFilter : public OptionsVisitor //! Formats selected options using the formatter. void formatSelected(FilterType type, - OptionsFormatterInterface *formatter, + IOptionsFormatter *formatter, const Options &options); virtual void visitSubSection(const Options §ion); virtual void visitOption(const OptionInfo &option); private: - OptionsFormatterInterface *formatter_; + IOptionsFormatter *formatter_; FilterType filterType_; bool bShowHidden_; @@ -213,7 +213,7 @@ class OptionsFilter : public OptionsVisitor }; void OptionsFilter::formatSelected(FilterType type, - OptionsFormatterInterface *formatter, + IOptionsFormatter *formatter, const Options &options) { formatter_ = formatter; @@ -382,7 +382,7 @@ descriptionWithOptionDetails(const CommonFormatterData &common, /*! \brief * Formatter implementation for synopsis. */ -class SynopsisFormatter : public OptionsFormatterInterface +class SynopsisFormatter : public IOptionsFormatter { public: //! Creates a helper object for formatting the synopsis. @@ -473,7 +473,7 @@ void SynopsisFormatter::formatOption(const OptionInfo &option) /*! \brief * Formatter implementation for help export. */ -class OptionsListFormatter : public OptionsFormatterInterface +class OptionsListFormatter : public IOptionsFormatter { public: //! Creates a helper object for formatting options. diff --git a/src/gromacs/commandline/cmdlineinit.cpp b/src/gromacs/commandline/cmdlineinit.cpp index 49786a1033..6652cbdd35 100644 --- a/src/gromacs/commandline/cmdlineinit.cpp +++ b/src/gromacs/commandline/cmdlineinit.cpp @@ -158,16 +158,16 @@ int processExceptionAtExitForCommandLine(const std::exception &ex) } int runCommandLineModule(int argc, char *argv[], - CommandLineModuleInterface *module) + ICommandLineModule *module) { return CommandLineModuleManager::runAsMainSingleModule(argc, argv, module); } int runCommandLineModule(int argc, char *argv[], const char *name, const char *description, - CommandLineOptionsModuleInterface *(*factory)()) + ICommandLineOptionsModule *(*factory)()) { - return CommandLineOptionsModuleInterface::runAsMain( + return ICommandLineOptionsModule::runAsMain( argc, argv, name, description, factory); } diff --git a/src/gromacs/commandline/cmdlineinit.h b/src/gromacs/commandline/cmdlineinit.h index e1fb961a35..f285e0b710 100644 --- a/src/gromacs/commandline/cmdlineinit.h +++ b/src/gromacs/commandline/cmdlineinit.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -52,8 +52,8 @@ namespace gmx { -class CommandLineModuleInterface; -class CommandLineOptionsModuleInterface; +class ICommandLineModule; +class ICommandLineOptionsModule; /*! \brief * Initializes the \Gromacs library for command-line use. @@ -137,7 +137,7 @@ int processExceptionAtExitForCommandLine(const std::exception &ex); * Does not throw. All exceptions are caught and handled internally. */ int runCommandLineModule(int argc, char *argv[], - CommandLineModuleInterface *module); + ICommandLineModule *module); /*! \brief * Implements a main() method that runs a single module. * @@ -154,12 +154,12 @@ int runCommandLineModule(int argc, char *argv[], * * Usage: * \code - class CustomCommandLineOptionsModule : public CommandLineOptionsModuleInterface + class CustomCommandLineOptionsModule : public ICommandLineOptionsModule { // <...> }; - static CommandLineOptionsModuleInterface *create() + static ICommandLineOptionsModule *create() { return new CustomCommandLineOptionsModule(); } @@ -175,7 +175,7 @@ int runCommandLineModule(int argc, char *argv[], */ int runCommandLineModule(int argc, char *argv[], const char *name, const char *description, - CommandLineOptionsModuleInterface *(*factory)()); + ICommandLineOptionsModule *(*factory)()); } // namespace gmx diff --git a/src/gromacs/commandline/cmdlinemodule.h b/src/gromacs/commandline/cmdlinemodule.h index f4252f1a1a..fd230241d9 100644 --- a/src/gromacs/commandline/cmdlinemodule.h +++ b/src/gromacs/commandline/cmdlinemodule.h @@ -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. @@ -34,7 +34,7 @@ */ /*! \file * \brief - * Declares gmx::CommandLineModuleInterface and supporting classes. + * Declares gmx::ICommandLineModule and supporting classes. * * \author Teemu Murtola * \inpublicapi @@ -90,10 +90,10 @@ class CommandLineModuleSettings * \inpublicapi * \ingroup module_commandline */ -class CommandLineModuleInterface +class ICommandLineModule { public: - virtual ~CommandLineModuleInterface() {} + virtual ~ICommandLineModule() {} //! Returns the name of the module. virtual const char *name() const = 0; @@ -137,7 +137,7 @@ class CommandLineModuleInterface //! \cond libapi /*! \libinternal \brief - * Helper to implement CommandLineModuleInterface::writeHelp() with a C-like + * Helper to implement ICommandLineModule::writeHelp() with a C-like * main() function that calls parse_common_args(). * * \param[in] context Context object for writing the help. diff --git a/src/gromacs/commandline/cmdlinemodulemanager.cpp b/src/gromacs/commandline/cmdlinemodulemanager.cpp index 95766c0ae7..a9fa6a0ad4 100644 --- a/src/gromacs/commandline/cmdlinemodulemanager.cpp +++ b/src/gromacs/commandline/cmdlinemodulemanager.cpp @@ -82,10 +82,10 @@ namespace */ /*! \brief - * Implements a CommandLineModuleInterface, given a function with C/C++ main() + * Implements a ICommandLineModule, given a function with C/C++ main() * signature. */ -class CMainCommandLineModule : public CommandLineModuleInterface +class CMainCommandLineModule : public ICommandLineModule { public: //! \copydoc gmx::CommandLineModuleManager::CMainFunction @@ -263,7 +263,7 @@ class CommandLineModuleManager::Impl * options). Also finds the module that should be run and the * arguments that should be passed to it. */ - CommandLineModuleInterface * + ICommandLineModule * processCommonOptions(CommandLineCommonOptionsHolder *optionsHolder, int *argc, char ***argv); @@ -292,7 +292,7 @@ class CommandLineModuleManager::Impl */ CommandLineHelpModule *helpModule_; //! If non-NULL, run this module in single-module mode. - CommandLineModuleInterface *singleModule_; + ICommandLineModule *singleModule_; //! Stores the value set with setQuiet(). bool bQuiet_; @@ -339,12 +339,12 @@ CommandLineModuleManager::Impl::findModuleByName(const std::string &name) const return modules_.find(name); } -CommandLineModuleInterface * +ICommandLineModule * CommandLineModuleManager::Impl::processCommonOptions( CommandLineCommonOptionsHolder *optionsHolder, int *argc, char ***argv) { // Check if we are directly invoking a certain module. - CommandLineModuleInterface *module = singleModule_; + ICommandLineModule *module = singleModule_; // TODO: It would be nice to propagate at least the -quiet option to // the modules so that they can also be quiet in response to this. @@ -437,13 +437,13 @@ void CommandLineModuleManager::setQuiet(bool bQuiet) } void CommandLineModuleManager::setOutputRedirector( - FileOutputRedirectorInterface *output) + IFileOutputRedirector *output) { impl_->ensureHelpModuleExists(); impl_->helpModule_->setOutputRedirector(output); } -void CommandLineModuleManager::setSingleModule(CommandLineModuleInterface *module) +void CommandLineModuleManager::setSingleModule(ICommandLineModule *module) { impl_->singleModule_ = module; } @@ -480,7 +480,7 @@ void CommandLineModuleManager::addHelpTopic(HelpTopicPointer topic) int CommandLineModuleManager::run(int argc, char *argv[]) { - CommandLineModuleInterface *module; + ICommandLineModule *module; const bool bMaster = (gmx_node_rank() == 0); bool bQuiet = impl_->bQuiet_ || !bMaster; CommandLineCommonOptionsHolder optionsHolder; @@ -562,7 +562,7 @@ int CommandLineModuleManager::run(int argc, char *argv[]) // static int CommandLineModuleManager::runAsMainSingleModule( - int argc, char *argv[], CommandLineModuleInterface *module) + int argc, char *argv[], ICommandLineModule *module) { CommandLineProgramContext &programContext = gmx::initForCommandLine(&argc, &argv); try diff --git a/src/gromacs/commandline/cmdlinemodulemanager.h b/src/gromacs/commandline/cmdlinemodulemanager.h index 4214ab1f1b..5271d242f7 100644 --- a/src/gromacs/commandline/cmdlinemodulemanager.h +++ b/src/gromacs/commandline/cmdlinemodulemanager.h @@ -43,7 +43,7 @@ #ifndef GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H #define GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H -#include "gromacs/onlinehelp/helptopicinterface.h" +#include "gromacs/onlinehelp/ihelptopic.h" #include "gromacs/utility/classhelpers.h" #include "gromacs/utility/uniqueptr.h" @@ -52,15 +52,15 @@ namespace gmx class CommandLineModuleGroup; class CommandLineModuleGroupData; -class CommandLineModuleInterface; class CommandLineProgramContext; -class FileOutputRedirectorInterface; +class ICommandLineModule; +class IFileOutputRedirector; //! \addtogroup module_commandline //! \{ -//! Smart pointer type for managing a CommandLineModuleInterface. -typedef gmx_unique_ptr::type +//! Smart pointer type for managing a ICommandLineModule. +typedef gmx_unique_ptr::type CommandLineModulePointer; /*! \libinternal \brief @@ -127,7 +127,7 @@ class CommandLineModuleManager * Does not throw. All exceptions are caught and handled internally. */ static int runAsMainSingleModule(int argc, char *argv[], - CommandLineModuleInterface *module); + ICommandLineModule *module); /*! \brief * Implements a main() method that runs a given function. * @@ -206,7 +206,7 @@ class CommandLineModuleManager * For tests, there should only be need to call this a single time, * right after creating the manager. */ - void setOutputRedirector(FileOutputRedirectorInterface *output); + void setOutputRedirector(IFileOutputRedirector *output); /*! \brief * Makes the manager always run a single module. @@ -217,7 +217,7 @@ class CommandLineModuleManager * directly passes all command-line arguments to \p module. * Help arguments are an exception: these are still recognized by the * manager and translated into a call to - * CommandLineModuleInterface::writeHelp(). + * ICommandLineModule::writeHelp(). * * This is public mainly for unit testing purposes; for other code, * runAsMainSingleModule() typically provides the desired @@ -225,7 +225,7 @@ class CommandLineModuleManager * * Does not throw. */ - void setSingleModule(CommandLineModuleInterface *module); + void setSingleModule(ICommandLineModule *module); /*! \brief * Adds a given module to this manager. * @@ -266,7 +266,7 @@ class CommandLineModuleManager * \throws std::bad_alloc if out of memory. * * \p Module must be default-constructible and implement - * CommandLineModuleInterface. + * ICommandLineModule. * * This method is provided as a convenient alternative to addModule() * for cases where each module is implemented by a different type diff --git a/src/gromacs/commandline/cmdlineoptionsmodule.cpp b/src/gromacs/commandline/cmdlineoptionsmodule.cpp index a0cb556813..2b560f161c 100644 --- a/src/gromacs/commandline/cmdlineoptionsmodule.cpp +++ b/src/gromacs/commandline/cmdlineoptionsmodule.cpp @@ -34,7 +34,7 @@ */ /*! \internal \file * \brief - * Implements supporting routines for gmx::CommandLineOptionsModuleInterface. + * Implements supporting routines for gmx::ICommandLineOptionsModule. * * \author Teemu Murtola * \ingroup module_commandline @@ -62,11 +62,11 @@ namespace * CommandLineOptionsModule */ -class CommandLineOptionsModule : public CommandLineModuleInterface +class CommandLineOptionsModule : public ICommandLineModule { public: //! Shorthand for the factory function pointer type. - typedef CommandLineOptionsModuleInterface::FactoryMethod FactoryMethod; + typedef ICommandLineOptionsModule::FactoryMethod FactoryMethod; CommandLineOptionsModule(const char *name, const char *description, FactoryMethod factory) @@ -74,7 +74,7 @@ class CommandLineOptionsModule : public CommandLineModuleInterface { } CommandLineOptionsModule(const char *name, const char *description, - CommandLineOptionsModuleInterface *module) + ICommandLineOptionsModule *module) : name_(name), description_(description), factory_(NULL), module_(module) { @@ -92,7 +92,7 @@ class CommandLineOptionsModule : public CommandLineModuleInterface const char *name_; const char *description_; FactoryMethod factory_; - boost::scoped_ptr module_; + boost::scoped_ptr module_; }; void CommandLineOptionsModule::init(CommandLineModuleSettings *settings) @@ -114,8 +114,8 @@ int CommandLineOptionsModule::run(int argc, char *argv[]) void CommandLineOptionsModule::writeHelp(const CommandLineHelpContext &context) const { - boost::scoped_ptr moduleGuard; - CommandLineOptionsModuleInterface *module = module_.get(); + boost::scoped_ptr moduleGuard; + ICommandLineOptionsModule *module = module_.get(); if (!module) { GMX_RELEASE_ASSERT(factory_ != NULL, "Neither factory nor module provided"); @@ -148,23 +148,23 @@ void CommandLineOptionsModule::parseOptions(int argc, char *argv[]) } // namespace /******************************************************************** - * CommandLineOptionsModuleInterface + * ICommandLineOptionsModule */ -CommandLineOptionsModuleInterface::~CommandLineOptionsModuleInterface() +ICommandLineOptionsModule::~ICommandLineOptionsModule() { } // static -CommandLineModuleInterface * -CommandLineOptionsModuleInterface::createModule( +ICommandLineModule * +ICommandLineOptionsModule::createModule( const char *name, const char *description, FactoryMethod factory) { return new CommandLineOptionsModule(name, description, factory); } // static -int CommandLineOptionsModuleInterface::runAsMain( +int ICommandLineOptionsModule::runAsMain( int argc, char *argv[], const char *name, const char *description, FactoryMethod factory) { @@ -173,7 +173,7 @@ int CommandLineOptionsModuleInterface::runAsMain( } // static -void CommandLineOptionsModuleInterface::registerModule( +void ICommandLineOptionsModule::registerModule( CommandLineModuleManager *manager, const char *name, const char *description, FactoryMethod factory) { @@ -182,9 +182,9 @@ void CommandLineOptionsModuleInterface::registerModule( } // static -void CommandLineOptionsModuleInterface::registerModule( +void ICommandLineOptionsModule::registerModule( CommandLineModuleManager *manager, const char *name, - const char *description, CommandLineOptionsModuleInterface *module) + const char *description, ICommandLineOptionsModule *module) { CommandLineModulePointer wrapperModule( new CommandLineOptionsModule(name, description, module)); diff --git a/src/gromacs/commandline/cmdlineoptionsmodule.h b/src/gromacs/commandline/cmdlineoptionsmodule.h index f44022fb08..f5a9056373 100644 --- a/src/gromacs/commandline/cmdlineoptionsmodule.h +++ b/src/gromacs/commandline/cmdlineoptionsmodule.h @@ -34,7 +34,7 @@ */ /*! \file * \brief - * Declares gmx::CommandLineOptionsModuleInterface and supporting routines. + * Declares gmx::ICommandLineOptionsModule and supporting routines. * * \author Teemu Murtola * \inpublicapi @@ -48,8 +48,8 @@ namespace gmx { -class CommandLineModuleInterface; class CommandLineModuleManager; +class ICommandLineModule; class Options; /*! \brief @@ -57,12 +57,12 @@ class Options; * argument processing. * * This class provides a higher-level interface on top of - * gmx::CommandLineModuleInterface for cases where gmx::Options will be used + * gmx::ICommandLineModule for cases where gmx::Options will be used * for declaring the command-line arguments. The module only needs to declare * the options it uses, and the framework takes care of command-line parsing * and help output. The module typically consists of the following parts: * - init() allows for some interaction between the module and the framework - * when running the module; see CommandLineModuleInterface::init(). If no + * when running the module; see ICommandLineModule::init(). If no * such customization is necessary, an empty implementation is sufficient. * - initOptions() is called both for running the module and for printing help * for the module, and it should add the options that the module @@ -75,8 +75,8 @@ class Options; * variables. * * registerModule(), runAsMain(), or createModule() can be used to use modules - * of this type in all contexts where a gmx::CommandLineModuleInterface is - * expected. These methods create a gmx::CommandLineModuleInterface + * of this type in all contexts where a gmx::ICommandLineModule is + * expected. These methods create a gmx::ICommandLineModule * implementation that contains the common code needed to parse command-line * options and write help, based on the information provided from the methods * in this class. @@ -84,7 +84,7 @@ class Options; * \inpublicapi * \ingroup module_commandline */ -class CommandLineOptionsModuleInterface +class ICommandLineOptionsModule { public: /*! \brief @@ -96,22 +96,22 @@ class CommandLineOptionsModuleInterface * * The caller takes responsibility to `delete` the returned pointer. */ - typedef CommandLineOptionsModuleInterface *(*FactoryMethod)(); + typedef ICommandLineOptionsModule *(*FactoryMethod)(); /*! \brief - * Creates a CommandLineModuleInterface to run the specified module. + * Creates a ICommandLineModule to run the specified module. * * \param[in] name Name for the module. * \param[in] description Short description for the module. * \param[in] factory Factory that returns the module to run. - * \returns CommandLineModuleInterface object that runs the module + * \returns ICommandLineModule object that runs the module * returned by \p factory. Caller must `delete` the object. * \throws std::bad_alloc if out of memory. * * This is mainly used by tests that want to bypass * CommandLineModuleManager. */ - static CommandLineModuleInterface * + static ICommandLineModule * createModule(const char *name, const char *description, FactoryMethod factory); /*! \brief @@ -142,7 +142,7 @@ class CommandLineOptionsModuleInterface * \param[in] factory Factory that returns the module to register. * \throws std::bad_alloc if out of memory. * - * This method internally creates a CommandLineModuleInterface module + * This method internally creates a ICommandLineModule module * with the given \p name and \p description, and adds that to * \p manager. When run or asked to write the help, the module calls * \p factory to get the actual module, and forwards the necessary @@ -162,21 +162,21 @@ class CommandLineOptionsModuleInterface * The method takes ownership (must have been allocated with `new`). * \throws std::bad_alloc if out of memory. * - * This method internally creates a CommandLineModuleInterface module + * This method internally creates a ICommandLineModule module * with the given \p name and \p description, and adds that to * \p manager. * * This method is mainly used by tests that need to have a reference to - * the CommandLineOptionsModuleInterface instance (e.g., for mocking). + * the ICommandLineOptionsModule instance (e.g., for mocking). */ static void registerModule(CommandLineModuleManager *manager, const char *name, const char *description, - CommandLineOptionsModuleInterface *module); + ICommandLineOptionsModule *module); - virtual ~CommandLineOptionsModuleInterface(); + virtual ~ICommandLineOptionsModule(); - //! \copydoc gmx::CommandLineModuleInterface::init() + //! \copydoc gmx::ICommandLineModule::init() virtual void init(CommandLineModuleSettings *settings) = 0; /*! \brief * Initializes command-line arguments understood by the module. diff --git a/src/gromacs/commandline/cmdlineprogramcontext.cpp b/src/gromacs/commandline/cmdlineprogramcontext.cpp index 64308a1a4c..c06b58ac18 100644 --- a/src/gromacs/commandline/cmdlineprogramcontext.cpp +++ b/src/gromacs/commandline/cmdlineprogramcontext.cpp @@ -86,12 +86,12 @@ std::string quoteIfNecessary(const char *str) } /*! \brief - * Default implementation for ExecutableEnvironmentInterface. + * Default implementation for IExecutableEnvironment. * - * Used if ExecutableEnvironmentInterface is not explicitly provided when + * Used if IExecutableEnvironment is not explicitly provided when * constructing CommandLineProgramContext. */ -class DefaultExecutableEnvironment : public ExecutableEnvironmentInterface +class DefaultExecutableEnvironment : public IExecutableEnvironment { public: //! Allocates a default environment. @@ -128,8 +128,8 @@ class DefaultExecutableEnvironment : public ExecutableEnvironmentInterface * If a binary with the given name cannot be located, \p invokedName is * returned. */ -std::string findFullBinaryPath(const std::string &invokedName, - const ExecutableEnvironmentInterface &env) +std::string findFullBinaryPath(const std::string &invokedName, + const IExecutableEnvironment &env) { std::string searchName = invokedName; // On Windows & Cygwin we need to add the .exe extension, diff --git a/src/gromacs/commandline/cmdlineprogramcontext.h b/src/gromacs/commandline/cmdlineprogramcontext.h index e08f350895..11c237cd48 100644 --- a/src/gromacs/commandline/cmdlineprogramcontext.h +++ b/src/gromacs/commandline/cmdlineprogramcontext.h @@ -72,10 +72,10 @@ namespace gmx * * \inlibraryapi */ -class ExecutableEnvironmentInterface +class IExecutableEnvironment { public: - virtual ~ExecutableEnvironmentInterface() {} + virtual ~IExecutableEnvironment() {} /*! \brief * Returns the working directory when the program was launched. @@ -90,8 +90,8 @@ class ExecutableEnvironmentInterface virtual std::vector getExecutablePaths() const = 0; }; -//! Shorthand for a smart pointer to ExecutableEnvironmentInterface. -typedef boost::shared_ptr +//! Shorthand for a smart pointer to IExecutableEnvironment. +typedef boost::shared_ptr ExecutableEnvironmentPointer; /*! \libinternal \brief @@ -109,7 +109,7 @@ typedef boost::shared_ptr * * \inlibraryapi */ -class CommandLineProgramContext : public ProgramContextInterface +class CommandLineProgramContext : public IProgramContext { public: /*! \brief @@ -143,13 +143,13 @@ class CommandLineProgramContext : public ProgramContextInterface * \param[in] env Customizes the way the binary name is handled. * * This overload allows one to customize the way the binary is located - * by providing a custom ExecutableEnvironmentInterface implementation. + * by providing a custom IExecutableEnvironment implementation. * This is mainly useful for testing purposes to make it possible to * test different paths without setting environment variables, changing * the working directory or doing other process-wide operations. * It may also be useful for making Gromacs behave better when linked * into a non-Gromacs executable (with possible extensions in - * ExecutableEnvironmentInterface). + * IExecutableEnvironment). */ CommandLineProgramContext(int argc, const char *const argv[], ExecutableEnvironmentPointer env); diff --git a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp index 5c33490f3a..e5c92f77e3 100644 --- a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp +++ b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp @@ -169,7 +169,7 @@ MockOptionsModule & CommandLineModuleManagerTestBase::addOptionsModule(const char *name, const char *description) { MockOptionsModule *module = new MockOptionsModule(); - gmx::CommandLineOptionsModuleInterface::registerModule( + gmx::ICommandLineOptionsModule::registerModule( &manager(), name, description, module); return *module; } diff --git a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h index ecb77a4f66..c41cc55bcc 100644 --- a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h +++ b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.h @@ -63,11 +63,11 @@ class MockHelpTopic; class TestFileOutputRedirector; /*! \internal \brief - * Mock implementation of gmx::CommandLineModuleInterface. + * Mock implementation of gmx::ICommandLineModule. * * \ingroup module_commandline */ -class MockModule : public gmx::CommandLineModuleInterface +class MockModule : public gmx::ICommandLineModule { public: //! Creates a mock module with the given name and description. @@ -97,11 +97,11 @@ class MockModule : public gmx::CommandLineModuleInterface }; /*! \internal \brief - * Mock implementation of gmx::CommandLineOptionsModuleInterface. + * Mock implementation of gmx::ICommandLineOptionsModule. * * \ingroup module_commandline */ -class MockOptionsModule : public gmx::CommandLineOptionsModuleInterface +class MockOptionsModule : public gmx::ICommandLineOptionsModule { public: MockOptionsModule(); diff --git a/src/gromacs/commandline/tests/cmdlineprogramcontext.cpp b/src/gromacs/commandline/tests/cmdlineprogramcontext.cpp index 3ffdad11aa..7f2048933a 100644 --- a/src/gromacs/commandline/tests/cmdlineprogramcontext.cpp +++ b/src/gromacs/commandline/tests/cmdlineprogramcontext.cpp @@ -73,7 +73,7 @@ using gmx::Path; namespace { -class TestExecutableEnvironment : public gmx::ExecutableEnvironmentInterface +class TestExecutableEnvironment : public gmx::IExecutableEnvironment { public: TestExecutableEnvironment() diff --git a/src/gromacs/gmxlib/copyrite.cpp b/src/gromacs/gmxlib/copyrite.cpp index e663af5bb9..abb0d80c4c 100644 --- a/src/gromacs/gmxlib/copyrite.cpp +++ b/src/gromacs/gmxlib/copyrite.cpp @@ -817,14 +817,14 @@ BinaryInformationSettings::BinaryInformationSettings() { } -void printBinaryInformation(FILE *fp, - const ProgramContextInterface &programContext) +void printBinaryInformation(FILE *fp, + const IProgramContext &programContext) { printBinaryInformation(fp, programContext, BinaryInformationSettings()); } void printBinaryInformation(FILE *fp, - const ProgramContextInterface &programContext, + const IProgramContext &programContext, const BinaryInformationSettings &settings) { const char *prefix = settings.prefix_; diff --git a/src/gromacs/gmxlib/oenv.cpp b/src/gromacs/gmxlib/oenv.cpp index 89201b8064..e835286bf7 100644 --- a/src/gromacs/gmxlib/oenv.cpp +++ b/src/gromacs/gmxlib/oenv.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -44,7 +44,7 @@ struct output_env { - explicit output_env(const gmx::ProgramContextInterface &context) + explicit output_env(const gmx::IProgramContext &context) : programContext(context) { time_unit = time_ps; @@ -53,7 +53,7 @@ struct output_env verbosity = 0; } - const gmx::ProgramContextInterface &programContext; + const gmx::IProgramContext &programContext; /* the time unit, enum defined in oenv.h */ time_unit_t time_unit; @@ -91,7 +91,7 @@ static const char *time_units_xvgr[] = { /***** OUTPUT_ENV MEMBER FUNCTIONS ******/ void output_env_init(output_env_t *oenvp, - const gmx::ProgramContextInterface &context, + const gmx::IProgramContext &context, time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format, int verbosity) { @@ -207,7 +207,7 @@ const char *output_env_get_program_display_name(const output_env_t oenv) return displayName; } -const gmx::ProgramContextInterface & +const gmx::IProgramContext & output_env_get_program_context(const output_env_t oenv) { return oenv->programContext; diff --git a/src/gromacs/gmxpreprocess/insert-molecules.cpp b/src/gromacs/gmxpreprocess/insert-molecules.cpp index 14b92616bc..34421a3c10 100644 --- a/src/gromacs/gmxpreprocess/insert-molecules.cpp +++ b/src/gromacs/gmxpreprocess/insert-molecules.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -303,7 +303,7 @@ namespace gmx namespace { -class InsertMolecules : public CommandLineOptionsModuleInterface +class InsertMolecules : public ICommandLineOptionsModule { public: InsertMolecules() @@ -541,7 +541,7 @@ int InsertMolecules::run() const char InsertMoleculesInfo::name[] = "insert-molecules"; const char InsertMoleculesInfo::shortDescription[] = "Insert molecules into existing vacancies"; -CommandLineOptionsModuleInterface *InsertMoleculesInfo::create() +ICommandLineOptionsModule *InsertMoleculesInfo::create() { return new InsertMolecules(); } diff --git a/src/gromacs/gmxpreprocess/insert-molecules.h b/src/gromacs/gmxpreprocess/insert-molecules.h index fd1552dfcd..dafa07fae7 100644 --- a/src/gromacs/gmxpreprocess/insert-molecules.h +++ b/src/gromacs/gmxpreprocess/insert-molecules.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -38,14 +38,14 @@ namespace gmx { -class CommandLineOptionsModuleInterface; +class ICommandLineOptionsModule; class InsertMoleculesInfo { public: static const char name[]; static const char shortDescription[]; - static CommandLineOptionsModuleInterface *create(); + static ICommandLineOptionsModule *create(); }; } // namespace gmx diff --git a/src/gromacs/legacyheaders/copyrite.h b/src/gromacs/legacyheaders/copyrite.h index 667dc9578d..f3fb4d9359 100644 --- a/src/gromacs/legacyheaders/copyrite.h +++ b/src/gromacs/legacyheaders/copyrite.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -77,7 +77,7 @@ please_cite(FILE *fp, const char *key); namespace gmx { -class ProgramContextInterface; +class IProgramContext; /*! \brief * Settings for printBinaryInformation(). @@ -129,7 +129,7 @@ class BinaryInformationSettings //! Needed to read the members without otherwise unnecessary accessors. friend void printBinaryInformation( - FILE *fp, const ProgramContextInterface &programContext, + FILE *fp, const IProgramContext &programContext, const BinaryInformationSettings &settings); }; @@ -140,7 +140,7 @@ class BinaryInformationSettings * \param[in] programContext Program information object to use. */ void printBinaryInformation(FILE *fp, - const ProgramContextInterface &programContext); + const IProgramContext &programContext); /*! \brief * Print basic information about the executable with custom settings. * @@ -151,7 +151,7 @@ void printBinaryInformation(FILE *fp, * \see BinaryInformationSettings */ void printBinaryInformation(FILE *fp, - const ProgramContextInterface &programContext, + const IProgramContext &programContext, const BinaryInformationSettings &settings); } // namespace gmx; diff --git a/src/gromacs/legacyheaders/oenv.h b/src/gromacs/legacyheaders/oenv.h index ade929e081..f12bfed276 100644 --- a/src/gromacs/legacyheaders/oenv.h +++ b/src/gromacs/legacyheaders/oenv.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * 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. @@ -117,11 +117,11 @@ const char *output_env_get_program_display_name(const output_env_t oenv); namespace gmx { -class ProgramContextInterface; +class IProgramContext; } // namespace gmx void output_env_init(output_env_t *oenvp, - const gmx::ProgramContextInterface &context, + const gmx::IProgramContext &context, time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format, int verbosity); /* initialize an output_env structure, setting the command line, @@ -130,9 +130,9 @@ void output_env_init(output_env_t *oenvp, the graph formatting type, the verbosity, and debug level */ /*! \brief - * Returns gmx::ProgramContextInterface from an output_env structure. + * Returns gmx::IProgramContext from an output_env structure. */ -const gmx::ProgramContextInterface & +const gmx::IProgramContext & output_env_get_program_context(const output_env_t oenv); #endif diff --git a/src/gromacs/onlinehelp-doc.h b/src/gromacs/onlinehelp-doc.h index fd1e7a0c9f..13acaaa2f9 100644 --- a/src/gromacs/onlinehelp-doc.h +++ b/src/gromacs/onlinehelp-doc.h @@ -48,7 +48,7 @@ * it can be rewrapped for console output. * - helpformat.h provides some general text-processing classes, currently * focused on producing aligned tables for console output. - * - helptopicinterface.h, helptopic.h, and helpmanager.h provide classes for + * - ihelptopic.h, helptopic.h, and helpmanager.h provide classes for * managing a hierarchy of help topics and printing out help from this * hierarchy. * diff --git a/src/gromacs/onlinehelp/helpmanager.cpp b/src/gromacs/onlinehelp/helpmanager.cpp index 89cb7cc811..60a8b7f48e 100644 --- a/src/gromacs/onlinehelp/helpmanager.cpp +++ b/src/gromacs/onlinehelp/helpmanager.cpp @@ -46,8 +46,8 @@ #include #include -#include "gromacs/onlinehelp/helptopicinterface.h" #include "gromacs/onlinehelp/helpwritercontext.h" +#include "gromacs/onlinehelp/ihelptopic.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/stringutil.h" @@ -67,7 +67,7 @@ class HelpManager::Impl { public: //! Container type for keeping the stack of active topics. - typedef std::vector TopicStack; + typedef std::vector TopicStack; //! Initializes a new manager with the given context. explicit Impl(const HelpWriterContext &context) @@ -78,7 +78,7 @@ class HelpManager::Impl //! Whether the active topic is the root topic. bool isAtRootTopic() const { return topicStack_.size() == 1; } //! Returns the active topic. - const HelpTopicInterface ¤tTopic() const + const IHelpTopic ¤tTopic() const { return *topicStack_.back(); } @@ -115,7 +115,7 @@ std::string HelpManager::Impl::currentTopicAsString() const * HelpManager */ -HelpManager::HelpManager(const HelpTopicInterface &rootTopic, +HelpManager::HelpManager(const IHelpTopic &rootTopic, const HelpWriterContext &context) : impl_(new Impl(context)) { @@ -128,14 +128,14 @@ HelpManager::~HelpManager() void HelpManager::enterTopic(const char *name) { - const HelpTopicInterface &topic = impl_->currentTopic(); + const IHelpTopic &topic = impl_->currentTopic(); if (!topic.hasSubTopics()) { GMX_THROW(InvalidInputError( formatString("Help topic '%s' has no subtopics", impl_->currentTopicAsString().c_str()))); } - const HelpTopicInterface *newTopic = topic.findSubTopic(name); + const IHelpTopic *newTopic = topic.findSubTopic(name); if (newTopic == NULL) { if (impl_->isAtRootTopic()) @@ -160,7 +160,7 @@ void HelpManager::enterTopic(const std::string &name) void HelpManager::writeCurrentTopic() const { - const HelpTopicInterface &topic = impl_->currentTopic(); + const IHelpTopic &topic = impl_->currentTopic(); const char *title = topic.title(); HelpWriterContext context(impl_->rootContext_); context.enterSubSection(title != NULL ? title : ""); diff --git a/src/gromacs/onlinehelp/helpmanager.h b/src/gromacs/onlinehelp/helpmanager.h index 97f78e926d..b258f3cac8 100644 --- a/src/gromacs/onlinehelp/helpmanager.h +++ b/src/gromacs/onlinehelp/helpmanager.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. @@ -50,8 +50,8 @@ namespace gmx { -class HelpTopicInterface; class HelpWriterContext; +class IHelpTopic; /*! \libinternal \brief * Helper for providing interactive online help. @@ -73,7 +73,7 @@ class HelpManager * The provided topic and context objects must remain valid for the * lifetime of this manager object. */ - HelpManager(const HelpTopicInterface &rootTopic, + HelpManager(const IHelpTopic &rootTopic, const HelpWriterContext &context); ~HelpManager(); diff --git a/src/gromacs/onlinehelp/helptopic.cpp b/src/gromacs/onlinehelp/helptopic.cpp index 6a3678ff6c..c1eafa9dac 100644 --- a/src/gromacs/onlinehelp/helptopic.cpp +++ b/src/gromacs/onlinehelp/helptopic.cpp @@ -65,7 +65,7 @@ bool AbstractSimpleHelpTopic::hasSubTopics() const return false; } -const HelpTopicInterface * +const IHelpTopic * AbstractSimpleHelpTopic::findSubTopic(const char * /* name */) const { return NULL; @@ -91,7 +91,7 @@ class AbstractCompositeHelpTopic::Impl //! Container for subtopics. typedef std::vector SubTopicList; //! Container for mapping subtopic names to help topic objects. - typedef std::map SubTopicMap; + typedef std::map SubTopicMap; /*! \brief * Subtopics in the order they were added. @@ -125,7 +125,7 @@ bool AbstractCompositeHelpTopic::hasSubTopics() const return !impl_->subTopics_.empty(); } -const HelpTopicInterface * +const IHelpTopic * AbstractCompositeHelpTopic::findSubTopic(const char *name) const { Impl::SubTopicMap::const_iterator topic = impl_->subTopicMap_.find(name); @@ -205,7 +205,7 @@ void AbstractCompositeHelpTopic::addSubTopic(HelpTopicPointer topic) { GMX_ASSERT(impl_->subTopicMap_.find(topic->name()) == impl_->subTopicMap_.end(), "Attempted to register a duplicate help topic name"); - const HelpTopicInterface *topicPtr = topic.get(); + const IHelpTopic *topicPtr = topic.get(); impl_->subTopics_.reserve(impl_->subTopics_.size() + 1); impl_->subTopicMap_.insert(std::make_pair(std::string(topicPtr->name()), topicPtr)); impl_->subTopics_.push_back(move(topic)); diff --git a/src/gromacs/onlinehelp/helptopic.h b/src/gromacs/onlinehelp/helptopic.h index 3a49e39bd0..d9027d6a57 100644 --- a/src/gromacs/onlinehelp/helptopic.h +++ b/src/gromacs/onlinehelp/helptopic.h @@ -34,7 +34,7 @@ */ /*! \libinternal \file * \brief - * Declares helper classes for implementing gmx::HelpTopicInterface. + * Declares helper classes for implementing gmx::IHelpTopic. * * \author Teemu Murtola * \inlibraryapi @@ -43,7 +43,7 @@ #ifndef GMX_ONLINEHELP_HELPTOPIC_H #define GMX_ONLINEHELP_HELPTOPIC_H -#include "gromacs/onlinehelp/helptopicinterface.h" +#include "gromacs/onlinehelp/ihelptopic.h" #include "gromacs/utility/classhelpers.h" #include "gromacs/utility/stringutil.h" #include "gromacs/utility/uniqueptr.h" @@ -54,7 +54,7 @@ namespace gmx /*! \libinternal \brief * Abstract base class for help topics that have simple text and no subtopics. * - * This class implements subtopic-related methods from HelpTopicInterface such + * This class implements subtopic-related methods from IHelpTopic such * that there are no subtopics. writeHelp() is also implemented such that it * uses HelpTopicContext::writeTextBlock() to write out the text returned by a * new virtual method helpText(). @@ -64,14 +64,14 @@ namespace gmx * \inlibraryapi * \ingroup module_onlinehelp */ -class AbstractSimpleHelpTopic : public HelpTopicInterface +class AbstractSimpleHelpTopic : public IHelpTopic { public: virtual const char *name() const = 0; virtual const char *title() const = 0; virtual bool hasSubTopics() const; - virtual const HelpTopicInterface *findSubTopic(const char *name) const; + virtual const IHelpTopic *findSubTopic(const char *name) const; virtual void writeHelp(const HelpWriterContext &context) const; @@ -90,8 +90,8 @@ class AbstractSimpleHelpTopic : public HelpTopicInterface * Abstract base class for help topics that have simple text and subtopics. * * This class implements an internal container for subtopics and provides - * public methods for adding subtopics (as HelpTopicInterface objects). - * Subtopic-related methods from HelpTopicInterface are implemented to access + * public methods for adding subtopics (as IHelpTopic objects). + * Subtopic-related methods from IHelpTopic are implemented to access * the internal container. writeHelp() is also implemented such that it * uses HelpTopicContext::writeTextBlock() to write out the text returned by a * new virtual method helpText(), and a list of subtopics is written after the @@ -102,7 +102,7 @@ class AbstractSimpleHelpTopic : public HelpTopicInterface * \inlibraryapi * \ingroup module_onlinehelp */ -class AbstractCompositeHelpTopic : public HelpTopicInterface +class AbstractCompositeHelpTopic : public IHelpTopic { public: AbstractCompositeHelpTopic(); @@ -112,7 +112,7 @@ class AbstractCompositeHelpTopic : public HelpTopicInterface virtual const char *title() const = 0; virtual bool hasSubTopics() const; - virtual const HelpTopicInterface *findSubTopic(const char *name) const; + virtual const IHelpTopic *findSubTopic(const char *name) const; virtual void writeHelp(const HelpWriterContext &context) const; @@ -134,7 +134,7 @@ class AbstractCompositeHelpTopic : public HelpTopicInterface * \throws std::bad_alloc if out of memory. * * \p Topic must be default-constructible and implement - * HelpTopicInterface. + * IHelpTopic. * * This method is provided as a convenient alternative to addSubTopic() * for cases where each topic is implemented by a different type diff --git a/src/gromacs/onlinehelp/helpwritercontext.cpp b/src/gromacs/onlinehelp/helpwritercontext.cpp index 07d2f29401..020d12fdfb 100644 --- a/src/gromacs/onlinehelp/helpwritercontext.cpp +++ b/src/gromacs/onlinehelp/helpwritercontext.cpp @@ -215,10 +215,10 @@ std::string repall(const std::string &s, const t_sandr (&sa)[nsr]) * Provides an interface that is used to implement different types of output * from HelpWriterContext::Impl::processMarkup(). */ -class WrapperInterface +class IWrapper { public: - virtual ~WrapperInterface() {} + virtual ~IWrapper() {} /*! \brief * Provides the wrapping settings. @@ -235,7 +235,7 @@ class WrapperInterface /*! \brief * Wraps markup output into a single string. */ -class WrapperToString : public WrapperInterface +class WrapperToString : public IWrapper { public: //! Creates a wrapper with the given settings. @@ -263,7 +263,7 @@ class WrapperToString : public WrapperInterface /*! \brief * Wraps markup output into a vector of string (one line per element). */ -class WrapperToVector : public WrapperInterface +class WrapperToVector : public IWrapper { public: //! Creates a wrapper with the given settings. @@ -520,7 +520,7 @@ class HelpWriterContext::Impl * or providing an interface for the caller to retrieve the output. */ void processMarkup(const std::string &text, - WrapperInterface *wrapper) const; + IWrapper *wrapper) const; //! Constant state shared by all child context objects. StatePointer state_; @@ -549,7 +549,7 @@ std::string HelpWriterContext::Impl::replaceLinks(const std::string &input) cons } void HelpWriterContext::Impl::processMarkup(const std::string &text, - WrapperInterface *wrapper) const + IWrapper *wrapper) const { std::string result(text); for (ReplaceList::const_iterator i = replacements_.begin(); diff --git a/src/gromacs/onlinehelp/helptopicinterface.h b/src/gromacs/onlinehelp/ihelptopic.h similarity index 90% rename from src/gromacs/onlinehelp/helptopicinterface.h rename to src/gromacs/onlinehelp/ihelptopic.h index 79dfbc390b..edb9343d32 100644 --- a/src/gromacs/onlinehelp/helptopicinterface.h +++ b/src/gromacs/onlinehelp/ihelptopic.h @@ -34,14 +34,14 @@ */ /*! \libinternal \file * \brief - * Declares gmx::HelpTopicInterface. + * Declares gmx::IHelpTopic. * * \author Teemu Murtola * \inlibraryapi * \ingroup module_onlinehelp */ -#ifndef GMX_ONLINEHELP_HELPTOPICINTERFACE_H -#define GMX_ONLINEHELP_HELPTOPICINTERFACE_H +#ifndef GMX_ONLINEHELP_IHELPTOPIC_H +#define GMX_ONLINEHELP_IHELPTOPIC_H #include "gromacs/utility/uniqueptr.h" @@ -63,10 +63,10 @@ class HelpWriterContext; * \inlibraryapi * \ingroup module_onlinehelp */ -class HelpTopicInterface +class IHelpTopic { public: - virtual ~HelpTopicInterface() {} + virtual ~IHelpTopic() {} /*! \brief * Returns the name of the topic. @@ -93,7 +93,7 @@ class HelpTopicInterface * \returns Pointer to the found subtopic, or NULL if matching topic * is not found. */ - virtual const HelpTopicInterface *findSubTopic(const char *name) const = 0; + virtual const IHelpTopic *findSubTopic(const char *name) const = 0; /*! \brief * Prints the help text for this topic. @@ -105,8 +105,8 @@ class HelpTopicInterface virtual void writeHelp(const HelpWriterContext &context) const = 0; }; -//! Smart pointer type to manage a HelpTopicInterface object. -typedef gmx_unique_ptr::type HelpTopicPointer; +//! Smart pointer type to manage a IHelpTopic object. +typedef gmx_unique_ptr::type HelpTopicPointer; } // namespace gmx diff --git a/src/gromacs/onlinehelp/tests/mock_helptopic.h b/src/gromacs/onlinehelp/tests/mock_helptopic.h index d1996e0b6f..e55f03eac5 100644 --- a/src/gromacs/onlinehelp/tests/mock_helptopic.h +++ b/src/gromacs/onlinehelp/tests/mock_helptopic.h @@ -34,7 +34,7 @@ */ /*! \libinternal \file * \brief - * Declares mock implementation of gmx::HelpTopicInterface. + * Declares mock implementation of gmx::IHelpTopic. * * \author Teemu Murtola * \inlibraryapi diff --git a/src/gromacs/options/filenameoptionmanager.cpp b/src/gromacs/options/filenameoptionmanager.cpp index 4f0767895b..212c6a26a5 100644 --- a/src/gromacs/options/filenameoptionmanager.cpp +++ b/src/gromacs/options/filenameoptionmanager.cpp @@ -81,7 +81,7 @@ const char *const c_compressedExtensions[] = */ std::string findExistingExtension(const std::string &prefix, const FileNameOptionInfo &option, - const FileInputRedirectorInterface *redirector) + const IFileInputRedirector *redirector) { ConstArrayRef types = option.fileTypes(); ConstArrayRef::const_iterator i; @@ -117,7 +117,7 @@ class FileNameOptionManager::Impl } //! Redirector for file existence checks. - const FileInputRedirectorInterface *redirector_; + const IFileInputRedirector *redirector_; //! Global default file name, if set. std::string defaultFileName_; //! Whether input option processing has been disabled. @@ -138,7 +138,7 @@ FileNameOptionManager::~FileNameOptionManager() } void FileNameOptionManager::setInputRedirector( - const FileInputRedirectorInterface *redirector) + const IFileInputRedirector *redirector) { impl_->redirector_ = redirector; } diff --git a/src/gromacs/options/filenameoptionmanager.h b/src/gromacs/options/filenameoptionmanager.h index 37f9f7c3bb..fd2099a40b 100644 --- a/src/gromacs/options/filenameoptionmanager.h +++ b/src/gromacs/options/filenameoptionmanager.h @@ -51,8 +51,8 @@ namespace gmx { -class FileInputRedirectorInterface; class FileNameOptionInfo; +class IFileInputRedirector; class Options; /*! \brief @@ -79,7 +79,7 @@ class Options; * \inpublicapi * \ingroup module_selection */ -class FileNameOptionManager : public OptionManagerInterface +class FileNameOptionManager : public IOptionManager { public: FileNameOptionManager(); @@ -101,7 +101,7 @@ class FileNameOptionManager : public OptionManagerInterface * For tests, there should only be need to call this a single time, * right after creating the manager. */ - void setInputRedirector(const FileInputRedirectorInterface *redirector); + void setInputRedirector(const IFileInputRedirector *redirector); /*! \brief * Disables special input file option handling. diff --git a/src/gromacs/options/optionmanagercontainer.h b/src/gromacs/options/optionmanagercontainer.h index 860b7a2aac..cfecedaa58 100644 --- a/src/gromacs/options/optionmanagercontainer.h +++ b/src/gromacs/options/optionmanagercontainer.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014, by the GROMACS development team, led by + * Copyright (c) 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. @@ -51,7 +51,7 @@ namespace gmx { -class OptionManagerInterface; +class IOptionManager; /*! \libinternal * \brief @@ -75,7 +75,7 @@ class OptionManagerContainer bool empty() const { return list_.empty(); } //! Adds a manager to the container. - void add(OptionManagerInterface *manager) + void add(IOptionManager *manager) { list_.push_back(manager); } @@ -83,7 +83,7 @@ class OptionManagerContainer * Retrieves a manager of a certain type. * * \tparam ManagerType Type of manager to retrieve - * (should derive from OptionManagerInterface). + * (should derive from IOptionManager). * \returns The manager, or `NULL` if there is none. * * This method is used in AbstractOption::createStorage() to retrieve @@ -112,7 +112,7 @@ class OptionManagerContainer private: //! Shorthand for the internal container type. - typedef std::vector ListType; + typedef std::vector ListType; ListType list_; diff --git a/src/gromacs/options/options.cpp b/src/gromacs/options/options.cpp index 3b587bef10..4048addbf3 100644 --- a/src/gromacs/options/options.cpp +++ b/src/gromacs/options/options.cpp @@ -56,10 +56,10 @@ namespace gmx { /******************************************************************** - * OptionManagerInterface + * IOptionManager */ -OptionManagerInterface::~OptionManagerInterface() +IOptionManager::~IOptionManager() { } @@ -157,7 +157,7 @@ void Options::setDescription(const ConstArrayRef &descArray) impl_->description_ = joinStrings(descArray, "\n"); } -void Options::addManager(OptionManagerInterface *manager) +void Options::addManager(IOptionManager *manager) { GMX_RELEASE_ASSERT(impl_->parent_ == NULL, "Can only add a manager in a top-level Options object"); diff --git a/src/gromacs/options/options.h b/src/gromacs/options/options.h index 1605fb88ac..452f96c6de 100644 --- a/src/gromacs/options/options.h +++ b/src/gromacs/options/options.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2011,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. @@ -76,10 +76,10 @@ class OptionsIterator; * \inlibraryapi * \ingroup module_options */ -class OptionManagerInterface +class IOptionManager { protected: - virtual ~OptionManagerInterface(); + virtual ~IOptionManager(); }; /*! \brief @@ -192,7 +192,7 @@ class Options * * This method cannot be called after adding options or subsections. */ - void addManager(OptionManagerInterface *manager); + void addManager(IOptionManager *manager); /*! \brief * Adds an option collection as a subsection of this collection. diff --git a/src/gromacs/selection/selectioncollection-impl.h b/src/gromacs/selection/selectioncollection-impl.h index abc9386830..b92ecf4c62 100644 --- a/src/gromacs/selection/selectioncollection-impl.h +++ b/src/gromacs/selection/selectioncollection-impl.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2009,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. @@ -50,7 +50,7 @@ #include -#include "gromacs/onlinehelp/helptopicinterface.h" +#include "gromacs/onlinehelp/ihelptopic.h" #include "gromacs/selection/indexutil.h" #include "gromacs/selection/selection.h" // For gmx::SelectionList #include "gromacs/selection/selectioncollection.h" diff --git a/src/gromacs/selection/selectionoptionmanager.h b/src/gromacs/selection/selectionoptionmanager.h index 7ddb866087..82e91749f4 100644 --- a/src/gromacs/selection/selectionoptionmanager.h +++ b/src/gromacs/selection/selectionoptionmanager.h @@ -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. @@ -79,7 +79,7 @@ class SelectionOptionStorage; * \inpublicapi * \ingroup module_selection */ -class SelectionOptionManager : public OptionManagerInterface +class SelectionOptionManager : public IOptionManager { public: /*! \brief diff --git a/src/gromacs/selection/selhelp.cpp b/src/gromacs/selection/selhelp.cpp index 131e9d25e8..0a29722728 100644 --- a/src/gromacs/selection/selhelp.cpp +++ b/src/gromacs/selection/selhelp.cpp @@ -774,7 +774,7 @@ void KeywordsHelpTopic::writeKeywordSubTopics(const HelpWriterContext &context) } } - const HelpTopicInterface *subTopic = findSubTopic(iter->first.c_str()); + const IHelpTopic *subTopic = findSubTopic(iter->first.c_str()); GMX_RELEASE_ASSERT(subTopic != NULL, "Keyword subtopic no longer exists"); HelpWriterContext subContext(context); subContext.enterSubSection(title); diff --git a/src/gromacs/selection/selhelp.h b/src/gromacs/selection/selhelp.h index b29251d31a..bfcea9ccfc 100644 --- a/src/gromacs/selection/selhelp.h +++ b/src/gromacs/selection/selhelp.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2014, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,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. @@ -43,7 +43,7 @@ #ifndef GMX_SELECTION_SELHELP_H #define GMX_SELECTION_SELHELP_H -#include "gromacs/onlinehelp/helptopicinterface.h" +#include "gromacs/onlinehelp/ihelptopic.h" namespace gmx { diff --git a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp index 675082f9b0..339c0c7fc8 100644 --- a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp +++ b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp @@ -285,7 +285,7 @@ TrajectoryAnalysisCommandLineRunner::writeHelp(const CommandLineHelpContext &con * \ingroup module_trajectoryanalysis */ class TrajectoryAnalysisCommandLineRunner::Impl::RunnerCommandLineModule - : public CommandLineModuleInterface + : public ICommandLineModule { public: /*! \brief diff --git a/src/gromacs/utility.h b/src/gromacs/utility.h index 7dc5f007f4..1583286821 100644 --- a/src/gromacs/utility.h +++ b/src/gromacs/utility.h @@ -153,7 +153,7 @@ * The header sysinfo.h declares gmx_getpid() for getting the current process * id. * - * The header programcontext.h declares a gmx::ProgramContextInterface that is + * The header programcontext.h declares a gmx::IProgramContext that is * used to * initialize and access information about the running program, such as the * name and path of the executable. This information is used, e.g., by the diff --git a/src/gromacs/utility/datafilefinder.h b/src/gromacs/utility/datafilefinder.h index f675fceba4..488c6c65de 100644 --- a/src/gromacs/utility/datafilefinder.h +++ b/src/gromacs/utility/datafilefinder.h @@ -171,7 +171,7 @@ class DataFileFinder * Constructs a default data file finder. * * The constructed finder searches only in the directory specified by - * the global program context (see ProgramContextInterface), and + * the global program context (see IProgramContext), and * optionally in the current directory. * * Does not throw. diff --git a/src/gromacs/utility/exceptions.cpp b/src/gromacs/utility/exceptions.cpp index cb683dafb2..5d85ec506b 100644 --- a/src/gromacs/utility/exceptions.cpp +++ b/src/gromacs/utility/exceptions.cpp @@ -254,10 +254,10 @@ namespace * exceptions while still supporting output to different formats (e.g., to a * string or to \c stderr). */ -class MessageWriterInterface +class IMessageWriter { public: - virtual ~MessageWriterInterface() {} + virtual ~IMessageWriter() {} /*! \brief * Writes a single line of text into the output. @@ -283,7 +283,7 @@ class MessageWriterInterface * Formats the messages into the provided FILE handle without checking for * errors in std::fprintf() calls. */ -class MessageWriterFileNoThrow : public MessageWriterInterface +class MessageWriterFileNoThrow : public IMessageWriter { public: //! Initializes a writer that writes to the given file handle. @@ -312,7 +312,7 @@ class MessageWriterFileNoThrow : public MessageWriterInterface /*! \brief * Exception information writer to format into a TextOutputStream. */ -class MessageWriterTextWriter : public MessageWriterInterface +class MessageWriterTextWriter : public IMessageWriter { public: //! Initializes a writer that writes to the given stream. @@ -345,7 +345,7 @@ class MessageWriterTextWriter : public MessageWriterInterface /*! \brief * Exception information writer to format into an std::string. */ -class MessageWriterString : public MessageWriterInterface +class MessageWriterString : public IMessageWriter { public: //! Post-processes the output string to not end in a line feed. @@ -394,7 +394,7 @@ class MessageWriterString : public MessageWriterInterface * * Does not throw unless the writer throws. */ -void formatExceptionMessageInternal(MessageWriterInterface *writer, +void formatExceptionMessageInternal(IMessageWriter *writer, const std::exception &ex, int indent) { const boost::exception *boostEx = dynamic_cast(&ex); diff --git a/src/gromacs/utility/fileredirector.cpp b/src/gromacs/utility/fileredirector.cpp index 68e595c477..9757afafb0 100644 --- a/src/gromacs/utility/fileredirector.cpp +++ b/src/gromacs/utility/fileredirector.cpp @@ -49,11 +49,11 @@ namespace gmx { -FileInputRedirectorInterface::~FileInputRedirectorInterface() +IFileInputRedirector::~IFileInputRedirector() { } -FileOutputRedirectorInterface::~FileOutputRedirectorInterface() +IFileOutputRedirector::~IFileOutputRedirector() { } @@ -68,7 +68,7 @@ namespace * * \ingroup module_utility */ -class DefaultInputRedirector : public FileInputRedirectorInterface +class DefaultInputRedirector : public IFileInputRedirector { public: virtual bool fileExists(const char *filename) const @@ -86,7 +86,7 @@ class DefaultInputRedirector : public FileInputRedirectorInterface * * \ingroup module_utility */ -class DefaultOutputRedirector : public FileOutputRedirectorInterface +class DefaultOutputRedirector : public IFileOutputRedirector { public: virtual TextOutputStream &standardOutput() @@ -102,13 +102,13 @@ class DefaultOutputRedirector : public FileOutputRedirectorInterface } // namespace //! \cond libapi -FileInputRedirectorInterface &defaultFileInputRedirector() +IFileInputRedirector &defaultFileInputRedirector() { static DefaultInputRedirector instance; return instance; } -FileOutputRedirectorInterface &defaultFileOutputRedirector() +IFileOutputRedirector &defaultFileOutputRedirector() { static DefaultOutputRedirector instance; return instance; diff --git a/src/gromacs/utility/fileredirector.h b/src/gromacs/utility/fileredirector.h index 407d57b924..fe670460f1 100644 --- a/src/gromacs/utility/fileredirector.h +++ b/src/gromacs/utility/fileredirector.h @@ -34,7 +34,7 @@ */ /*! \libinternal \file * \brief - * Declares gmx::FileOutputRedirectorInterface. + * Declares gmx::IFileOutputRedirector. * * \author Teemu Murtola * \inlibraryapi @@ -57,7 +57,7 @@ namespace gmx * all file system operations that need to support this redirection. * * This allows tests to override the file existence checks without actually - * using the file system. See FileOutputRedirectorInterface for notes on + * using the file system. See IFileOutputRedirector for notes on * a typical usage pattern. * * With some further refactoring of the File class, this could also support @@ -67,10 +67,10 @@ namespace gmx * \inlibraryapi * \ingroup module_utility */ -class FileInputRedirectorInterface +class IFileInputRedirector { public: - virtual ~FileInputRedirectorInterface(); + virtual ~IFileInputRedirector(); /*! \brief * Checks whether the provided path exists (and is a file). @@ -110,10 +110,10 @@ class FileInputRedirectorInterface * \inlibraryapi * \ingroup module_utility */ -class FileOutputRedirectorInterface +class IFileOutputRedirector { public: - virtual ~FileOutputRedirectorInterface(); + virtual ~IFileOutputRedirector(); /*! \brief * Returns a stream to use for `stdout` output. @@ -135,7 +135,7 @@ class FileOutputRedirectorInterface //! \cond libapi /*! \brief - * Returns default implementation for FileInputRedirectorInterface. + * Returns default implementation for IFileInputRedirector. * * The returned implementation does not redirect anything, but just uses the * file system normally. @@ -144,9 +144,9 @@ class FileOutputRedirectorInterface * * \ingroup module_utility */ -FileInputRedirectorInterface &defaultFileInputRedirector(); +IFileInputRedirector &defaultFileInputRedirector(); /*! \brief - * Returns default implementation for FileOutputRedirectorInterface. + * Returns default implementation for IFileOutputRedirector. * * The returned implementation does not redirect anything, but just opens the * files at requested locations. @@ -155,7 +155,7 @@ FileInputRedirectorInterface &defaultFileInputRedirector(); * * \ingroup module_utility */ -FileOutputRedirectorInterface &defaultFileOutputRedirector(); +IFileOutputRedirector &defaultFileOutputRedirector(); //! \endcond } // namespace gmx diff --git a/src/gromacs/utility/programcontext.cpp b/src/gromacs/utility/programcontext.cpp index 5edf9aa284..4de54036ab 100644 --- a/src/gromacs/utility/programcontext.cpp +++ b/src/gromacs/utility/programcontext.cpp @@ -34,7 +34,7 @@ */ /*! \internal \file * \brief - * Implements gmx::ProgramContextInterface and related methods. + * Implements gmx::IProgramContext and related methods. * * \author Teemu Murtola * \ingroup module_utility @@ -55,14 +55,14 @@ namespace //! \{ /*! \brief - * Default implementation of ProgramContextInterface. + * Default implementation of IProgramContext. * * This implementation is used if nothing has been set with * setProgramContext(). * * Since it is constructed using a global initializer, it should not throw. */ -class DefaultProgramContext : public ProgramContextInterface +class DefaultProgramContext : public IProgramContext { public: DefaultProgramContext() {} @@ -78,7 +78,7 @@ class DefaultProgramContext : public ProgramContextInterface }; //! Global program info; stores the object set with setProgramContext(). -const ProgramContextInterface *g_programContext; +const IProgramContext *g_programContext; //! Default program context if nothing is set. const DefaultProgramContext g_defaultContext; @@ -86,7 +86,7 @@ const DefaultProgramContext g_defaultContext; } // namespace -const ProgramContextInterface &getProgramContext() +const IProgramContext &getProgramContext() { if (g_programContext != NULL) { @@ -95,7 +95,7 @@ const ProgramContextInterface &getProgramContext() return g_defaultContext; } -void setProgramContext(const ProgramContextInterface *programContext) +void setProgramContext(const IProgramContext *programContext) { g_programContext = programContext; } diff --git a/src/gromacs/utility/programcontext.h b/src/gromacs/utility/programcontext.h index d7aede1988..9ac1729936 100644 --- a/src/gromacs/utility/programcontext.h +++ b/src/gromacs/utility/programcontext.h @@ -34,7 +34,7 @@ */ /*! \file * \brief - * Declares gmx::ProgramContextInterface and related methods. + * Declares gmx::IProgramContext and related methods. * * \author Teemu Murtola * \inpublicapi @@ -51,7 +51,7 @@ namespace gmx /*! \brief * Provides information about installation prefix (see - * ProgramContextInterface::installationPrefix()). + * IProgramContext::installationPrefix()). * * \inpublicapi */ @@ -109,7 +109,7 @@ struct InstallationPrefixInfo * \see setProgramContext() * \inpublicapi */ -class ProgramContextInterface +class IProgramContext { public: /*! \brief @@ -164,11 +164,11 @@ class ProgramContextInterface virtual const char *commandLine() const = 0; protected: - virtual ~ProgramContextInterface() {} + virtual ~IProgramContext() {} }; /*! \brief - * Returns the global ProgramContextInterface instance. + * Returns the global IProgramContext instance. * * \returns The context set with setProgramContext(). * @@ -185,11 +185,11 @@ class ProgramContextInterface * the presence of such calls. For example, initForCommandLine() assumes that * such calls do not exist to be able to free the context before exiting. * - * \see ProgramContextInterface + * \see IProgramContext */ -const ProgramContextInterface &getProgramContext(); +const IProgramContext &getProgramContext(); /*! \brief - * Sets the global ProgramContextInterface instance. + * Sets the global IProgramContext instance. * * \param[in] context Program context to set * (can be NULL to restore the default context). @@ -209,9 +209,9 @@ const ProgramContextInterface &getProgramContext(); * * Does not throw. * - * \see ProgramContextInterface + * \see IProgramContext */ -void setProgramContext(const ProgramContextInterface *context); +void setProgramContext(const IProgramContext *context); //! \} diff --git a/src/programs/legacymodules.cpp b/src/programs/legacymodules.cpp index 9872b06c4d..2b3a9b40dc 100644 --- a/src/programs/legacymodules.cpp +++ b/src/programs/legacymodules.cpp @@ -69,7 +69,7 @@ namespace * Prints a message directing the user to a wiki page describing replacement * options. */ -class ObsoleteToolModule : public gmx::CommandLineModuleInterface +class ObsoleteToolModule : public gmx::ICommandLineModule { public: //! Creates an obsolete tool module for a tool with the given name. @@ -115,7 +115,7 @@ class ObsoleteToolModule : public gmx::CommandLineModuleInterface // TODO: Consider removing duplication with CMainCommandLineModule from // cmdlinemodulemanager.cpp. -class NoNiceModule : public gmx::CommandLineModuleInterface +class NoNiceModule : public gmx::ICommandLineModule { public: //! \copydoc gmx::CommandLineModuleManager::CMainFunction @@ -233,7 +233,7 @@ void registerLegacyModules(gmx::CommandLineModuleManager *manager) registerModuleNoNice(manager, &gmx_mdrun, "mdrun", "Perform a simulation, do a normal mode analysis or an energy minimization"); - gmx::CommandLineOptionsModuleInterface::registerModule( + gmx::ICommandLineOptionsModule::registerModule( manager, gmx::InsertMoleculesInfo::name, gmx::InsertMoleculesInfo::shortDescription, &gmx::InsertMoleculesInfo::create); diff --git a/src/testutils/cmdlinetest.cpp b/src/testutils/cmdlinetest.cpp index 6b336b27f3..3a848c9454 100644 --- a/src/testutils/cmdlinetest.cpp +++ b/src/testutils/cmdlinetest.cpp @@ -264,7 +264,7 @@ class CommandLineTestHelper::Impl // static int CommandLineTestHelper::runModule( - CommandLineModuleInterface *module, CommandLine *commandLine) + ICommandLineModule *module, CommandLine *commandLine) { CommandLineModuleSettings settings; module->init(&settings); @@ -273,12 +273,12 @@ int CommandLineTestHelper::runModule( // static int CommandLineTestHelper::runModule( - CommandLineOptionsModuleInterface::FactoryMethod factory, + ICommandLineOptionsModule::FactoryMethod factory, CommandLine *commandLine) { // The name and description are not used in the tests, so they can be NULL. - boost::scoped_ptr module( - CommandLineOptionsModuleInterface::createModule(NULL, NULL, factory)); + boost::scoped_ptr module( + ICommandLineOptionsModule::createModule(NULL, NULL, factory)); return runModule(module.get(), commandLine); } diff --git a/src/testutils/cmdlinetest.h b/src/testutils/cmdlinetest.h index 519911f16e..5c1feec7ea 100644 --- a/src/testutils/cmdlinetest.h +++ b/src/testutils/cmdlinetest.h @@ -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. @@ -55,8 +55,8 @@ namespace gmx { -class CommandLineModuleInterface; -class CommandLineOptionsModuleInterface; +class ICommandLineModule; +class ICommandLineOptionsModule; namespace test { @@ -206,7 +206,7 @@ class CommandLineTestHelper { public: /*! \brief - * Runs a command-line program that implements CommandLineModuleInterface. + * Runs a command-line program that implements ICommandLineModule. * * \param[in,out] module Module to run. * The function does not take ownership. @@ -216,10 +216,10 @@ class CommandLineTestHelper * \throws unspecified Any exception thrown by the module. */ static int - runModule(CommandLineModuleInterface *module, CommandLine *commandLine); + runModule(ICommandLineModule *module, CommandLine *commandLine); /*! \brief * Runs a command-line program that implements - * CommandLineOptionsModuleInterface. + * ICommandLineOptionsModule. * * \param[in] factory Factory method for the module to run. * \param[in,out] commandLine Command line parameters to pass. @@ -229,7 +229,7 @@ class CommandLineTestHelper * module. */ static int - runModule(CommandLineOptionsModuleInterface *(*factory)(), + runModule(ICommandLineOptionsModule *(*factory)(), CommandLine *commandLine); /*! \brief diff --git a/src/testutils/testfileredirector.h b/src/testutils/testfileredirector.h index ccb3a69490..550acf55a2 100644 --- a/src/testutils/testfileredirector.h +++ b/src/testutils/testfileredirector.h @@ -57,7 +57,7 @@ namespace test class TestReferenceChecker; /*! \libinternal \brief - * In-memory implementation for FileInputRedirectorInterface for tests. + * In-memory implementation for IFileInputRedirector for tests. * * By default, this implementation will return `false` for all file existence * checks. To return `true` for a specific path, use addExistingFile(). @@ -65,7 +65,7 @@ class TestReferenceChecker; * \inlibraryapi * \ingroup module_testutils */ -class TestFileInputRedirector : public FileInputRedirectorInterface +class TestFileInputRedirector : public IFileInputRedirector { public: TestFileInputRedirector(); @@ -80,7 +80,7 @@ class TestFileInputRedirector : public FileInputRedirectorInterface */ void addExistingFile(const char *filename); - // From FileInputRedirectorInterface + // From IFileInputRedirector virtual bool fileExists(const char *filename) const; private: @@ -90,14 +90,14 @@ class TestFileInputRedirector : public FileInputRedirectorInterface }; /*! \libinternal \brief - * In-memory implementation of FileOutputRedirectorInterface for tests. + * In-memory implementation of IFileOutputRedirector for tests. * * This class redirects all output files to in-memory buffers, and supports * checking the contents of these files using the reference data framework. * * \ingroup module_testutils */ -class TestFileOutputRedirector : public FileOutputRedirectorInterface +class TestFileOutputRedirector : public IFileOutputRedirector { public: TestFileOutputRedirector(); @@ -113,7 +113,7 @@ class TestFileOutputRedirector : public FileOutputRedirectorInterface */ void checkRedirectedFiles(TestReferenceChecker *checker); - // From FileOutputRedirectorInterface + // From IFileOutputRedirector virtual TextOutputStream &standardOutput(); virtual TextOutputStreamPointer openTextOutputFile(const char *filename); diff --git a/src/testutils/testinit.cpp b/src/testutils/testinit.cpp index a17ed2309d..a8bead662c 100644 --- a/src/testutils/testinit.cpp +++ b/src/testutils/testinit.cpp @@ -88,7 +88,7 @@ namespace * * \ingroup module_testutils */ -class TestProgramContext : public ProgramContextInterface +class TestProgramContext : public IProgramContext { public: /*! \brief @@ -96,7 +96,7 @@ class TestProgramContext : public ProgramContextInterface * * \param[in] context Current \Gromacs program context. */ - explicit TestProgramContext(const ProgramContextInterface &context) + explicit TestProgramContext(const IProgramContext &context) : context_(context), dataPath_(CMAKE_SOURCE_DIR) { } @@ -131,7 +131,7 @@ class TestProgramContext : public ProgramContextInterface } private: - const ProgramContextInterface &context_; + const IProgramContext &context_; std::string dataPath_; }; diff --git a/src/testutils/testutils-doc.h b/src/testutils/testutils-doc.h index a82192dc4d..5c627688ab 100644 --- a/src/testutils/testutils-doc.h +++ b/src/testutils/testutils-doc.h @@ -53,10 +53,10 @@ * temporary files that need to be created during the test. * - gmx::test::TestFileInputRedirector (in testfileredirector.h) provides * functionality for capturing file existence checks in code that uses - * gmx::FileInputRedirectorInterface. + * gmx::IFileInputRedirector. * - gmx::test::TestFileOutputRedirector (in testfileredirector.h) provides * functionality for capturing file output (including `stdout`) from code - * that uses gmx::FileOutputRedirectorInterface, and checking that output + * that uses gmx::IFileOutputRedirector, and checking that output * against reference data. * - gmx::test::InteractiveTestHelper (in interactivetest.h) provides * a helper class for testing an interactive session that uses -- 2.22.0