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.
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
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.
====================
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.
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.
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
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
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
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
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.
<dl>
<dt>gmx::AnalysisDataAverageModule</dt>
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
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.
/*
* 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.
* 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
* 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.
*
* <H3>Data Modules</H3>
*
- * 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
* 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
*
* 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
/*
* 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.
void
-AbstractAnalysisData::applyModule(AnalysisDataModuleInterface *module)
+AbstractAnalysisData::applyModule(IAnalysisDataModule *module)
{
impl_->modules_.applyModule(this, module);
}
/*
* 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.
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<AnalysisDataModuleInterface> AnalysisDataModulePointer;
+typedef boost::shared_ptr<IAnalysisDataModule> AnalysisDataModulePointer;
/*! \brief
* Abstract base class for all objects that provide data.
* storage (addModule() has the same problem if called after data is
* started).
*/
- void applyModule(AnalysisDataModuleInterface *module);
+ void applyModule(IAnalysisDataModule *module);
protected:
/*! \cond libapi */
/*
* 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.
* \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.
*
* \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
*
* \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()
* \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
*
* \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
/*
* 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.
*/
/*! \file
* \brief
- * Declares gmx::AnalysisDataModuleInterface and related convenience classes.
+ * Declares gmx::IAnalysisDataModule and related convenience classes.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inlibraryapi
* \inlibraryapi
* \ingroup module_analysisdata
*/
-class AnalysisDataModuleInterface
+class IAnalysisDataModule
{
public:
/*! \brief
efAllowMultipleDataSets = 1<<4
};
- virtual ~AnalysisDataModuleInterface() {};
+ virtual ~IAnalysisDataModule() {};
/*! \brief
* Returns properties supported by the module.
* \inlibraryapi
* \ingroup module_analysisdata
*/
-class AnalysisDataModuleSerial : public AnalysisDataModuleInterface
+class AnalysisDataModuleSerial : public IAnalysisDataModule
{
public:
virtual ~AnalysisDataModuleSerial() {}
* \inlibraryapi
* \ingroup module_analysisdata
*/
-class AnalysisDataModuleParallel : public AnalysisDataModuleInterface
+class AnalysisDataModuleParallel : public IAnalysisDataModule
{
public:
virtual ~AnalysisDataModuleParallel() {}
/*
* 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.
* \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.
* 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.
* 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_;
void
AnalysisDataModuleManager::Impl::checkModuleProperty(
- const AnalysisDataModuleInterface &module,
+ const IAnalysisDataModule &module,
DataProperty property, bool bSet) const
{
bool bOk = true;
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;
}
void
AnalysisDataModuleManager::Impl::checkModuleProperties(
- const AnalysisDataModuleInterface &module) const
+ const IAnalysisDataModule &module) const
{
for (int i = 0; i < eDataPropertyNR; ++i)
{
}
void
-AnalysisDataModuleManager::Impl::presentData(AbstractAnalysisData *data,
- AnalysisDataModuleInterface *module)
+AnalysisDataModuleManager::Impl::presentData(AbstractAnalysisData *data,
+ IAnalysisDataModule *module)
{
if (state_ == eNotStarted)
{
"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);
"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;
}
}
void
-AnalysisDataModuleManager::applyModule(AbstractAnalysisData *data,
- AnalysisDataModuleInterface *module)
+AnalysisDataModuleManager::applyModule(AbstractAnalysisData *data,
+ IAnalysisDataModule *module)
{
impl_->checkModuleProperties(*module);
GMX_RELEASE_ASSERT(impl_->state_ == Impl::eFinished,
/*
* 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.
/*! \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
/*! \brief
* Identifies data properties to check with data modules.
*
- * \see AnalysisDataModuleInterface::Flag
+ * \see IAnalysisDataModule::Flag
*/
enum DataProperty
{
*
* \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.
* \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
* derived from AbstractAnalysisData.
*
* This method initializes all modules for serial processing by calling
- * AnalysisDataModuleInterface::dataStarted().
+ * IAnalysisDataModule::dataStarted().
*/
void notifyDataStart(AbstractAnalysisData *data);
/*! \brief
* \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.
*
* \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.
*
* \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
* 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
* 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.
*
* \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.
*
* \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.
* 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.
*/
/*
* 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.
* 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
/*
* 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.
* 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
* 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.
*
/*
* 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.
*
* \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.
/*! \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
* 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();
/*
* 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.
* 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 <teemu.murtola@gmail.com>
* \ingroup module_analysisdata
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));
}
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));
}
/*
* 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.
* 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 <teemu.murtola@gmail.com>
* \ingroup module_analysisdata
/*
* 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.
* \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
* \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
* \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().
* 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.
*/
* \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().
/*
* 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.
* 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
{
* 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
{
* Functor for requesting data storage.
*
* This functor is designed to be invoked as a handled for
- * AnalysisDataModuleInterface::dataStarted().
+ * IAnalysisDataModule::dataStarted().
*/
class DataStorageRequester
{
* data.
*
* This functor is designed to be invoked as a handled for
- * AnalysisDataModuleInterface::pointsAdded().
+ * IAnalysisDataModule::pointsAdded().
*/
class StaticDataPointsStorageChecker
{
/*
* 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.
*/
/*! \libinternal \file
* \brief
- * Declares mock implementation of gmx::AnalysisDataModuleInterface.
+ * Declares mock implementation of gmx::IAnalysisDataModule.
*
* Requires Google Mock.
*
class AnalysisDataTestInput;
class TestReferenceChecker;
-class MockAnalysisDataModule : public AnalysisDataModuleInterface
+class MockAnalysisDataModule : public IAnalysisDataModule
{
public:
explicit MockAnalysisDataModule(int flags);
/*
* 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.
* - 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
namespace
{
-class HelpExportInterface;
+class IHelpExport;
class RootHelpTopic;
} // namespace
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<RootHelpTopic> 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);
};
{
/********************************************************************
- * HelpExportInterface
+ * IHelpExport
*/
/*! \brief
*
* \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.
* \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
*
* \param[in] topic Topic to export.
*/
- virtual void exportTopic(const HelpTopicInterface &topic) = 0;
+ virtual void exportTopic(const IHelpTopic &topic) = 0;
};
/********************************************************************
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;
GMX_DISALLOW_COPY_AND_ASSIGN(RootHelpTopic);
};
-void RootHelpTopic::exportHelp(HelpExportInterface *exporter)
+void RootHelpTopic::exportHelp(IHelpExport *exporter)
{
std::vector<std::string>::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);
}
*
* \ingroup module_commandline
*/
-class CommandsHelpTopic : public HelpTopicInterface
+class CommandsHelpTopic : public IHelpTopic
{
public:
/*! \brief
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;
}
/*! \brief
* Help topic wrapper for a command-line module.
*
- * This class implements HelpTopicInterface such that it wraps a
- * CommandLineModuleInterface, allowing subcommand "help <command>"
+ * This class implements IHelpTopic such that it wraps a
+ * ICommandLineModule, allowing subcommand "help <command>"
* to produce the help for "<command>".
*
* \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)
{
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);
*
* \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();
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<TextWriter> indexFile_;
HelpExportReStructuredText::HelpExportReStructuredText(
const CommandLineHelpModuleImpl &helpModule,
- FileOutputRedirectorInterface *outputRedirector)
+ IFileOutputRedirector *outputRedirector)
: outputRedirector_(outputRedirector),
binaryName_(helpModule.binaryName_),
links_(eHelpOutputFormat_Rst)
}
void HelpExportReStructuredText::exportModuleHelp(
- const CommandLineModuleInterface &module,
+ const ICommandLineModule &module,
const std::string &tag,
const std::string &displayName)
{
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));
*
* \ingroup module_commandline
*/
-class HelpExportCompletion : public HelpExportInterface
+class HelpExportCompletion : public IHelpExport
{
public:
//! Initializes completion exporter.
virtual void startModuleExport();
virtual void exportModuleHelp(
- const CommandLineModuleInterface &module,
+ const ICommandLineModule &module,
const std::string &tag,
const std::string &displayName);
virtual void finishModuleExport();
const ModuleGroupContents & /*modules*/) {}
virtual void finishModuleGroupExport() {}
- virtual void exportTopic(const HelpTopicInterface & /*topic*/) {}
+ virtual void exportTopic(const IHelpTopic & /*topic*/) {}
private:
ShellCompletionWriter bashWriter_;
}
void HelpExportCompletion::exportModuleHelp(
- const CommandLineModuleInterface &module,
+ const ICommandLineModule &module,
const std::string & /*tag*/,
const std::string & /*displayName*/)
{
*/
CommandLineHelpModuleImpl::CommandLineHelpModuleImpl(
- const ProgramContextInterface &programContext,
+ const IProgramContext &programContext,
const std::string &binaryName,
const CommandLineModuleMap &modules,
const CommandLineModuleGroupList &groups)
{
}
-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.
public:
ModificationCheckingFileOutputStream(
const char *path,
- FileOutputRedirectorInterface *redirector)
+ IFileOutputRedirector *redirector)
: path_(path), redirector_(redirector)
{
}
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)
{
}
}
private:
- FileOutputRedirectorInterface *redirector_;
+ IFileOutputRedirector *redirector_;
};
} // namespace
*/
CommandLineHelpModule::CommandLineHelpModule(
- const ProgramContextInterface &programContext,
+ const IProgramContext &programContext,
const std::string &binaryName,
const CommandLineModuleMap &modules,
const CommandLineModuleGroupList &groups)
}
HelpTopicPointer CommandLineHelpModule::createModuleHelpTopic(
- const CommandLineModuleInterface &module) const
+ const ICommandLineModule &module) const
{
return HelpTopicPointer(new ModuleHelpTopic(module, *impl_));
}
}
void CommandLineHelpModule::setModuleOverride(
- const CommandLineModuleInterface &module)
+ const ICommandLineModule &module)
{
impl_->moduleOverride_ = &module;
}
void CommandLineHelpModule::setOutputRedirector(
- FileOutputRedirectorInterface *output)
+ IFileOutputRedirector *output)
{
impl_->outputRedirector_ = output;
}
if (!exportFormat.empty())
{
ModificationCheckingFileOutputRedirector redirector(impl_->outputRedirector_);
- boost::scoped_ptr<HelpExportInterface> exporter;
+ boost::scoped_ptr<IHelpExport> exporter;
if (exportFormat == "rst")
{
exporter.reset(new HelpExportReStructuredText(*impl_, &redirector));
#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"
{
class CommandLineHelpContext;
-class FileOutputRedirectorInterface;
-class ProgramContextInterface;
+class IFileOutputRedirector;
+class IProgramContext;
class CommandLineHelpModuleImpl;
*
* \ingroup module_commandline
*/
-class CommandLineHelpModule : public CommandLineModuleInterface
+class CommandLineHelpModule : public ICommandLineModule
{
public:
/*! \brief
* \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);
* safety in CommandLineModuleManager::addModule().
*/
HelpTopicPointer
- createModuleHelpTopic(const CommandLineModuleInterface &module) const;
+ createModuleHelpTopic(const ICommandLineModule &module) const;
/*! \brief
* Adds a top-level help topic.
*
* 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.
* 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
}
/********************************************************************
- * OptionsFormatterInterface
+ * IOptionsFormatter
*/
/*! \brief
*
* \see OptionsFilter
*/
-class OptionsFormatterInterface
+class IOptionsFormatter
{
public:
- virtual ~OptionsFormatterInterface() {}
+ virtual ~IOptionsFormatter() {}
//! Formats a single option option.
virtual void formatOption(const OptionInfo &option) = 0;
*
* 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.
*/
//! 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_;
};
void OptionsFilter::formatSelected(FilterType type,
- OptionsFormatterInterface *formatter,
+ IOptionsFormatter *formatter,
const Options &options)
{
formatter_ = formatter;
/*! \brief
* Formatter implementation for synopsis.
*/
-class SynopsisFormatter : public OptionsFormatterInterface
+class SynopsisFormatter : public IOptionsFormatter
{
public:
//! Creates a helper object for formatting the synopsis.
/*! \brief
* Formatter implementation for help export.
*/
-class OptionsListFormatter : public OptionsFormatterInterface
+class OptionsListFormatter : public IOptionsFormatter
{
public:
//! Creates a helper object for formatting options.
}
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);
}
/*
* 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.
namespace gmx
{
-class CommandLineModuleInterface;
-class CommandLineOptionsModuleInterface;
+class ICommandLineModule;
+class ICommandLineOptionsModule;
/*! \brief
* Initializes the \Gromacs library for command-line use.
* 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.
*
*
* Usage:
* \code
- class CustomCommandLineOptionsModule : public CommandLineOptionsModuleInterface
+ class CustomCommandLineOptionsModule : public ICommandLineOptionsModule
{
// <...>
};
- static CommandLineOptionsModuleInterface *create()
+ static ICommandLineOptionsModule *create()
{
return new CustomCommandLineOptionsModule();
}
*/
int runCommandLineModule(int argc, char *argv[],
const char *name, const char *description,
- CommandLineOptionsModuleInterface *(*factory)());
+ ICommandLineOptionsModule *(*factory)());
} // namespace gmx
/*
* 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.
*/
/*! \file
* \brief
- * Declares gmx::CommandLineModuleInterface and supporting classes.
+ * Declares gmx::ICommandLineModule and supporting classes.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inpublicapi
* \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;
//! \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.
*/
/*! \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
* 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);
*/
CommandLineHelpModule *helpModule_;
//! If non-NULL, run this module in single-module mode.
- CommandLineModuleInterface *singleModule_;
+ ICommandLineModule *singleModule_;
//! Stores the value set with setQuiet().
bool bQuiet_;
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.
}
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;
}
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;
// static
int CommandLineModuleManager::runAsMainSingleModule(
- int argc, char *argv[], CommandLineModuleInterface *module)
+ int argc, char *argv[], ICommandLineModule *module)
{
CommandLineProgramContext &programContext = gmx::initForCommandLine(&argc, &argv);
try
#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"
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<CommandLineModuleInterface>::type
+//! Smart pointer type for managing a ICommandLineModule.
+typedef gmx_unique_ptr<ICommandLineModule>::type
CommandLineModulePointer;
/*! \libinternal \brief
* 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.
*
* 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.
* 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
*
* Does not throw.
*/
- void setSingleModule(CommandLineModuleInterface *module);
+ void setSingleModule(ICommandLineModule *module);
/*! \brief
* Adds a given module to this manager.
*
* \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
*/
/*! \internal \file
* \brief
- * Implements supporting routines for gmx::CommandLineOptionsModuleInterface.
+ * Implements supporting routines for gmx::ICommandLineOptionsModule.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_commandline
* 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)
{
}
CommandLineOptionsModule(const char *name, const char *description,
- CommandLineOptionsModuleInterface *module)
+ ICommandLineOptionsModule *module)
: name_(name), description_(description), factory_(NULL),
module_(module)
{
const char *name_;
const char *description_;
FactoryMethod factory_;
- boost::scoped_ptr<CommandLineOptionsModuleInterface> module_;
+ boost::scoped_ptr<ICommandLineOptionsModule> module_;
};
void CommandLineOptionsModule::init(CommandLineModuleSettings *settings)
void CommandLineOptionsModule::writeHelp(const CommandLineHelpContext &context) const
{
- boost::scoped_ptr<CommandLineOptionsModuleInterface> moduleGuard;
- CommandLineOptionsModuleInterface *module = module_.get();
+ boost::scoped_ptr<ICommandLineOptionsModule> moduleGuard;
+ ICommandLineOptionsModule *module = module_.get();
if (!module)
{
GMX_RELEASE_ASSERT(factory_ != NULL, "Neither factory nor module provided");
} // 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)
{
}
// static
-void CommandLineOptionsModuleInterface::registerModule(
+void ICommandLineOptionsModule::registerModule(
CommandLineModuleManager *manager, const char *name,
const char *description, FactoryMethod factory)
{
}
// 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));
*/
/*! \file
* \brief
- * Declares gmx::CommandLineOptionsModuleInterface and supporting routines.
+ * Declares gmx::ICommandLineOptionsModule and supporting routines.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inpublicapi
namespace gmx
{
-class CommandLineModuleInterface;
class CommandLineModuleManager;
+class ICommandLineModule;
class Options;
/*! \brief
* 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
* 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.
* \inpublicapi
* \ingroup module_commandline
*/
-class CommandLineOptionsModuleInterface
+class ICommandLineOptionsModule
{
public:
/*! \brief
*
* 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
* \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
* 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.
}
/*! \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.
* 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,
*
* \inlibraryapi
*/
-class ExecutableEnvironmentInterface
+class IExecutableEnvironment
{
public:
- virtual ~ExecutableEnvironmentInterface() {}
+ virtual ~IExecutableEnvironment() {}
/*! \brief
* Returns the working directory when the program was launched.
virtual std::vector<std::string> getExecutablePaths() const = 0;
};
-//! Shorthand for a smart pointer to ExecutableEnvironmentInterface.
-typedef boost::shared_ptr<ExecutableEnvironmentInterface>
+//! Shorthand for a smart pointer to IExecutableEnvironment.
+typedef boost::shared_ptr<IExecutableEnvironment>
ExecutableEnvironmentPointer;
/*! \libinternal \brief
*
* \inlibraryapi
*/
-class CommandLineProgramContext : public ProgramContextInterface
+class CommandLineProgramContext : public IProgramContext
{
public:
/*! \brief
* \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);
CommandLineModuleManagerTestBase::addOptionsModule(const char *name, const char *description)
{
MockOptionsModule *module = new MockOptionsModule();
- gmx::CommandLineOptionsModuleInterface::registerModule(
+ gmx::ICommandLineOptionsModule::registerModule(
&manager(), name, description, module);
return *module;
}
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.
};
/*! \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();
namespace
{
-class TestExecutableEnvironment : public gmx::ExecutableEnvironmentInterface
+class TestExecutableEnvironment : public gmx::IExecutableEnvironment
{
public:
TestExecutableEnvironment()
{
}
-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_;
*
* 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.
struct output_env
{
- explicit output_env(const gmx::ProgramContextInterface &context)
+ explicit output_env(const gmx::IProgramContext &context)
: programContext(context)
{
time_unit = time_ps;
verbosity = 0;
}
- const gmx::ProgramContextInterface &programContext;
+ const gmx::IProgramContext &programContext;
/* the time unit, enum defined in oenv.h */
time_unit_t time_unit;
/***** 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)
{
return displayName;
}
-const gmx::ProgramContextInterface &
+const gmx::IProgramContext &
output_env_get_program_context(const output_env_t oenv)
{
return oenv->programContext;
*
* 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.
namespace
{
-class InsertMolecules : public CommandLineOptionsModuleInterface
+class InsertMolecules : public ICommandLineOptionsModule
{
public:
InsertMolecules()
const char InsertMoleculesInfo::name[] = "insert-molecules";
const char InsertMoleculesInfo::shortDescription[] =
"Insert molecules into existing vacancies";
-CommandLineOptionsModuleInterface *InsertMoleculesInfo::create()
+ICommandLineOptionsModule *InsertMoleculesInfo::create()
{
return new InsertMolecules();
}
/*
* 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.
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
*
* 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.
namespace gmx
{
-class ProgramContextInterface;
+class IProgramContext;
/*! \brief
* Settings for printBinaryInformation().
//! 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);
};
* \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.
*
* \see BinaryInformationSettings
*/
void printBinaryInformation(FILE *fp,
- const ProgramContextInterface &programContext,
+ const IProgramContext &programContext,
const BinaryInformationSettings &settings);
} // namespace gmx;
*
* 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.
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,
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
* 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.
*
#include <string>
#include <vector>
-#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"
{
public:
//! Container type for keeping the stack of active topics.
- typedef std::vector<const HelpTopicInterface *> TopicStack;
+ typedef std::vector<const IHelpTopic *> TopicStack;
//! Initializes a new manager with the given context.
explicit Impl(const HelpWriterContext &context)
//! 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();
}
* HelpManager
*/
-HelpManager::HelpManager(const HelpTopicInterface &rootTopic,
+HelpManager::HelpManager(const IHelpTopic &rootTopic,
const HelpWriterContext &context)
: impl_(new Impl(context))
{
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())
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 : "");
/*
* 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.
namespace gmx
{
-class HelpTopicInterface;
class HelpWriterContext;
+class IHelpTopic;
/*! \libinternal \brief
* Helper for providing interactive online help.
* 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();
return false;
}
-const HelpTopicInterface *
+const IHelpTopic *
AbstractSimpleHelpTopic::findSubTopic(const char * /* name */) const
{
return NULL;
//! Container for subtopics.
typedef std::vector<HelpTopicPointer> SubTopicList;
//! Container for mapping subtopic names to help topic objects.
- typedef std::map<std::string, const HelpTopicInterface *> SubTopicMap;
+ typedef std::map<std::string, const IHelpTopic *> SubTopicMap;
/*! \brief
* Subtopics in the order they were added.
return !impl_->subTopics_.empty();
}
-const HelpTopicInterface *
+const IHelpTopic *
AbstractCompositeHelpTopic::findSubTopic(const char *name) const
{
Impl::SubTopicMap::const_iterator topic = impl_->subTopicMap_.find(name);
{
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));
*/
/*! \libinternal \file
* \brief
- * Declares helper classes for implementing gmx::HelpTopicInterface.
+ * Declares helper classes for implementing gmx::IHelpTopic.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inlibraryapi
#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"
/*! \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().
* \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;
* 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
* \inlibraryapi
* \ingroup module_onlinehelp
*/
-class AbstractCompositeHelpTopic : public HelpTopicInterface
+class AbstractCompositeHelpTopic : public IHelpTopic
{
public:
AbstractCompositeHelpTopic();
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;
* \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
* 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.
/*! \brief
* Wraps markup output into a single string.
*/
-class WrapperToString : public WrapperInterface
+class WrapperToString : public IWrapper
{
public:
//! Creates a wrapper with the given settings.
/*! \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.
* 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_;
}
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();
*/
/*! \libinternal \file
* \brief
- * Declares gmx::HelpTopicInterface.
+ * Declares gmx::IHelpTopic.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \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"
* \inlibraryapi
* \ingroup module_onlinehelp
*/
-class HelpTopicInterface
+class IHelpTopic
{
public:
- virtual ~HelpTopicInterface() {}
+ virtual ~IHelpTopic() {}
/*! \brief
* Returns the name of the topic.
* \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.
virtual void writeHelp(const HelpWriterContext &context) const = 0;
};
-//! Smart pointer type to manage a HelpTopicInterface object.
-typedef gmx_unique_ptr<HelpTopicInterface>::type HelpTopicPointer;
+//! Smart pointer type to manage a IHelpTopic object.
+typedef gmx_unique_ptr<IHelpTopic>::type HelpTopicPointer;
} // namespace gmx
*/
/*! \libinternal \file
* \brief
- * Declares mock implementation of gmx::HelpTopicInterface.
+ * Declares mock implementation of gmx::IHelpTopic.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inlibraryapi
*/
std::string findExistingExtension(const std::string &prefix,
const FileNameOptionInfo &option,
- const FileInputRedirectorInterface *redirector)
+ const IFileInputRedirector *redirector)
{
ConstArrayRef<int> types = option.fileTypes();
ConstArrayRef<int>::const_iterator i;
}
//! 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.
}
void FileNameOptionManager::setInputRedirector(
- const FileInputRedirectorInterface *redirector)
+ const IFileInputRedirector *redirector)
{
impl_->redirector_ = redirector;
}
namespace gmx
{
-class FileInputRedirectorInterface;
class FileNameOptionInfo;
+class IFileInputRedirector;
class Options;
/*! \brief
* \inpublicapi
* \ingroup module_selection
*/
-class FileNameOptionManager : public OptionManagerInterface
+class FileNameOptionManager : public IOptionManager
{
public:
FileNameOptionManager();
* 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.
/*
* 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.
namespace gmx
{
-class OptionManagerInterface;
+class IOptionManager;
/*! \libinternal
* \brief
bool empty() const { return list_.empty(); }
//! Adds a manager to the container.
- void add(OptionManagerInterface *manager)
+ void add(IOptionManager *manager)
{
list_.push_back(manager);
}
* 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
private:
//! Shorthand for the internal container type.
- typedef std::vector<OptionManagerInterface *> ListType;
+ typedef std::vector<IOptionManager *> ListType;
ListType list_;
{
/********************************************************************
- * OptionManagerInterface
+ * IOptionManager
*/
-OptionManagerInterface::~OptionManagerInterface()
+IOptionManager::~IOptionManager()
{
}
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");
/*
* 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.
* \inlibraryapi
* \ingroup module_options
*/
-class OptionManagerInterface
+class IOptionManager
{
protected:
- virtual ~OptionManagerInterface();
+ virtual ~IOptionManager();
};
/*! \brief
*
* 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.
/*
* 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.
#include <boost/scoped_ptr.hpp>
-#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"
/*
* 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.
* \inpublicapi
* \ingroup module_selection
*/
-class SelectionOptionManager : public OptionManagerInterface
+class SelectionOptionManager : public IOptionManager
{
public:
/*! \brief
}
}
- 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);
/*
* 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.
#ifndef GMX_SELECTION_SELHELP_H
#define GMX_SELECTION_SELHELP_H
-#include "gromacs/onlinehelp/helptopicinterface.h"
+#include "gromacs/onlinehelp/ihelptopic.h"
namespace gmx
{
* \ingroup module_trajectoryanalysis
*/
class TrajectoryAnalysisCommandLineRunner::Impl::RunnerCommandLineModule
- : public CommandLineModuleInterface
+ : public ICommandLineModule
{
public:
/*! \brief
* 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
* 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.
* 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.
* 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.
/*! \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.
/*! \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.
*
* 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<const boost::exception *>(&ex);
namespace gmx
{
-FileInputRedirectorInterface::~FileInputRedirectorInterface()
+IFileInputRedirector::~IFileInputRedirector()
{
}
-FileOutputRedirectorInterface::~FileOutputRedirectorInterface()
+IFileOutputRedirector::~IFileOutputRedirector()
{
}
*
* \ingroup module_utility
*/
-class DefaultInputRedirector : public FileInputRedirectorInterface
+class DefaultInputRedirector : public IFileInputRedirector
{
public:
virtual bool fileExists(const char *filename) const
*
* \ingroup module_utility
*/
-class DefaultOutputRedirector : public FileOutputRedirectorInterface
+class DefaultOutputRedirector : public IFileOutputRedirector
{
public:
virtual TextOutputStream &standardOutput()
} // namespace
//! \cond libapi
-FileInputRedirectorInterface &defaultFileInputRedirector()
+IFileInputRedirector &defaultFileInputRedirector()
{
static DefaultInputRedirector instance;
return instance;
}
-FileOutputRedirectorInterface &defaultFileOutputRedirector()
+IFileOutputRedirector &defaultFileOutputRedirector()
{
static DefaultOutputRedirector instance;
return instance;
*/
/*! \libinternal \file
* \brief
- * Declares gmx::FileOutputRedirectorInterface.
+ * Declares gmx::IFileOutputRedirector.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inlibraryapi
* 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
* \inlibraryapi
* \ingroup module_utility
*/
-class FileInputRedirectorInterface
+class IFileInputRedirector
{
public:
- virtual ~FileInputRedirectorInterface();
+ virtual ~IFileInputRedirector();
/*! \brief
* Checks whether the provided path exists (and is a file).
* \inlibraryapi
* \ingroup module_utility
*/
-class FileOutputRedirectorInterface
+class IFileOutputRedirector
{
public:
- virtual ~FileOutputRedirectorInterface();
+ virtual ~IFileOutputRedirector();
/*! \brief
* Returns a stream to use for `stdout` output.
//! \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.
*
* \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.
*
* \ingroup module_utility
*/
-FileOutputRedirectorInterface &defaultFileOutputRedirector();
+IFileOutputRedirector &defaultFileOutputRedirector();
//! \endcond
} // namespace gmx
*/
/*! \internal \file
* \brief
- * Implements gmx::ProgramContextInterface and related methods.
+ * Implements gmx::IProgramContext and related methods.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_utility
//! \{
/*! \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() {}
};
//! 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;
} // namespace
-const ProgramContextInterface &getProgramContext()
+const IProgramContext &getProgramContext()
{
if (g_programContext != NULL)
{
return g_defaultContext;
}
-void setProgramContext(const ProgramContextInterface *programContext)
+void setProgramContext(const IProgramContext *programContext)
{
g_programContext = programContext;
}
*/
/*! \file
* \brief
- * Declares gmx::ProgramContextInterface and related methods.
+ * Declares gmx::IProgramContext and related methods.
*
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \inpublicapi
/*! \brief
* Provides information about installation prefix (see
- * ProgramContextInterface::installationPrefix()).
+ * IProgramContext::installationPrefix()).
*
* \inpublicapi
*/
* \see setProgramContext()
* \inpublicapi
*/
-class ProgramContextInterface
+class IProgramContext
{
public:
/*! \brief
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().
*
* 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).
*
* Does not throw.
*
- * \see ProgramContextInterface
+ * \see IProgramContext
*/
-void setProgramContext(const ProgramContextInterface *context);
+void setProgramContext(const IProgramContext *context);
//! \}
* 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.
// TODO: Consider removing duplication with CMainCommandLineModule from
// cmdlinemodulemanager.cpp.
-class NoNiceModule : public gmx::CommandLineModuleInterface
+class NoNiceModule : public gmx::ICommandLineModule
{
public:
//! \copydoc gmx::CommandLineModuleManager::CMainFunction
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);
// static
int CommandLineTestHelper::runModule(
- CommandLineModuleInterface *module, CommandLine *commandLine)
+ ICommandLineModule *module, CommandLine *commandLine)
{
CommandLineModuleSettings settings;
module->init(&settings);
// 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<CommandLineModuleInterface> module(
- CommandLineOptionsModuleInterface::createModule(NULL, NULL, factory));
+ boost::scoped_ptr<ICommandLineModule> module(
+ ICommandLineOptionsModule::createModule(NULL, NULL, factory));
return runModule(module.get(), commandLine);
}
/*
* 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.
namespace gmx
{
-class CommandLineModuleInterface;
-class CommandLineOptionsModuleInterface;
+class ICommandLineModule;
+class ICommandLineOptionsModule;
namespace test
{
{
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.
* \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.
* module.
*/
static int
- runModule(CommandLineOptionsModuleInterface *(*factory)(),
+ runModule(ICommandLineOptionsModule *(*factory)(),
CommandLine *commandLine);
/*! \brief
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().
* \inlibraryapi
* \ingroup module_testutils
*/
-class TestFileInputRedirector : public FileInputRedirectorInterface
+class TestFileInputRedirector : public IFileInputRedirector
{
public:
TestFileInputRedirector();
*/
void addExistingFile(const char *filename);
- // From FileInputRedirectorInterface
+ // From IFileInputRedirector
virtual bool fileExists(const char *filename) const;
private:
};
/*! \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();
*/
void checkRedirectedFiles(TestReferenceChecker *checker);
- // From FileOutputRedirectorInterface
+ // From IFileOutputRedirector
virtual TextOutputStream &standardOutput();
virtual TextOutputStreamPointer openTextOutputFile(const char *filename);
*
* \ingroup module_testutils
*/
-class TestProgramContext : public ProgramContextInterface
+class TestProgramContext : public IProgramContext
{
public:
/*! \brief
*
* \param[in] context Current \Gromacs program context.
*/
- explicit TestProgramContext(const ProgramContextInterface &context)
+ explicit TestProgramContext(const IProgramContext &context)
: context_(context), dataPath_(CMAKE_SOURCE_DIR)
{
}
}
private:
- const ProgramContextInterface &context_;
+ const IProgramContext &context_;
std::string dataPath_;
};
* 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