From 33772581813867cd285fc66c761601a30aa476ec Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Mon, 7 Jul 2014 07:41:26 +0300 Subject: [PATCH] Remove selection help from SelectionCollection Instead, make the only caller outside the selection module to use selhelp.h directly. This is not significantly messier, and allows removing one use of gmx_unique_ptr from an installed header. To actually remove that instance, do not install helptopicinterface.h. This has the added benefit that now the whole onlinehelp module is free from public headers, making the interface cleaner. Adjust doxygen documentation accordingly. Part of #1454 Change-Id: Ifb557da86fb0d422650029812d30cc6766730fb9 --- doxygen/directories.cpp | 2 +- src/gromacs/commandline/shellcompletions.h | 2 +- src/gromacs/onlinehelp.h | 65 ------------------- src/gromacs/onlinehelp/CMakeLists.txt | 4 -- src/gromacs/onlinehelp/helptopicinterface.h | 23 ++++--- src/gromacs/onlinehelp/helpwritercontext.cpp | 2 +- src/gromacs/selection/selectioncollection.cpp | 7 -- src/gromacs/selection/selectioncollection.h | 9 --- src/gromacs/selection/selhelp.cpp | 4 +- src/gromacs/selection/selhelp.h | 9 +-- src/programs/gmx.cpp | 4 +- 11 files changed, 27 insertions(+), 104 deletions(-) delete mode 100644 src/gromacs/onlinehelp.h diff --git a/doxygen/directories.cpp b/doxygen/directories.cpp index 13de5ee377..c7bd01ab35 100644 --- a/doxygen/directories.cpp +++ b/doxygen/directories.cpp @@ -48,7 +48,7 @@ Doxygen documentation file for directories in the source tree. \ingroup module_commandline */ -/*! +/*! \libinternal \dir src/gromacs/onlinehelp \brief \ref module_onlinehelp diff --git a/src/gromacs/commandline/shellcompletions.h b/src/gromacs/commandline/shellcompletions.h index b2f01cfbb8..b16ec2f5c8 100644 --- a/src/gromacs/commandline/shellcompletions.h +++ b/src/gromacs/commandline/shellcompletions.h @@ -57,7 +57,7 @@ class File; class Options; //! \cond internal -//! \addtogroup module_onlinehelp +//! \addtogroup module_commandline //! \{ //! Output format for ShellCompletionWriter. diff --git a/src/gromacs/onlinehelp.h b/src/gromacs/onlinehelp.h deleted file mode 100644 index 9a5caf609d..0000000000 --- a/src/gromacs/onlinehelp.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 2014, by the GROMACS development team, led by - * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, - * and including many others, as listed in the AUTHORS file in the - * top-level source directory and at http://www.gromacs.org. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ -/*! \defgroup module_onlinehelp Help Formatting for Online Help (onlinehelp) - * \ingroup group_utilitymodules - * \brief - * Provides functionality for formatting help text for console and other - * formats. - * - * This module provides helper functions and classes for formatting console - * help, as well as man pages and HTML help from the source code. It should - * not be necessary to call any methods in this module outside the \Gromacs - * library. - * - * \author Teemu Murtola - */ -/*! \file - * \brief - * Public API convenience header for help formatting. - * - * This module does not provide any classes that are intended to be used - * outside the library. It only contains some type declarations that are - * necessary for implementation reasons in other public API headers. - * - * \author Teemu Murtola - * \inlibraryapi - * \ingroup module_onlinehelp - */ -#ifndef GMX_ONLINEHELP_H -#define GMX_ONLINEHELP_H - -#include "onlinehelp/helptopicinterface.h" - -#endif diff --git a/src/gromacs/onlinehelp/CMakeLists.txt b/src/gromacs/onlinehelp/CMakeLists.txt index a6448783a8..c34de31cc0 100644 --- a/src/gromacs/onlinehelp/CMakeLists.txt +++ b/src/gromacs/onlinehelp/CMakeLists.txt @@ -35,10 +35,6 @@ file(GLOB ONLINEHELP_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ONLINEHELP_SOURCES} PARENT_SCOPE) -set(ONLINEHELP_PUBLIC_HEADERS - helptopicinterface.h) -gmx_install_headers(onlinehelp ${ONLINEHELP_PUBLIC_HEADERS}) - if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/onlinehelp/helptopicinterface.h b/src/gromacs/onlinehelp/helptopicinterface.h index 1c6926369f..e3f0c92d44 100644 --- a/src/gromacs/onlinehelp/helptopicinterface.h +++ b/src/gromacs/onlinehelp/helptopicinterface.h @@ -32,7 +32,20 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ -/*! \file +/*! \libinternal \defgroup module_onlinehelp Help Formatting for Online Help (onlinehelp) + * \ingroup group_utilitymodules + * \brief + * Provides functionality for formatting help text for console and other + * formats. + * + * This module provides helper functions and classes for formatting console + * help, as well as man pages and HTML help from the source code. It should + * not be necessary to call any methods in this module outside the \Gromacs + * library. + * + * \author Teemu Murtola + */ +/*! \libinternal \file * \brief * Declares gmx::HelpTopicInterface. * @@ -50,21 +63,15 @@ namespace gmx class HelpWriterContext; -/*! \brief +/*! \libinternal \brief * Provides a single online help topic. * - * \if libapi * Implementations of these methods should not throw, except that writeHelp() * is allowed to throw on out-of-memory or I/O errors since those it cannot * avoid. * * Header helptopic.h contains classes that implement this interface and make * it simple to write concrete help topic classes. - * \endif - * - * This class is in a public header, and exposed through HelpTopicPointer, but - * it is not intended to be used outside the library. To access a help topic - * with public API methods, use HelpManager. * * \inlibraryapi * \ingroup module_onlinehelp diff --git a/src/gromacs/onlinehelp/helpwritercontext.cpp b/src/gromacs/onlinehelp/helpwritercontext.cpp index 649ab7849d..00e7bd33a9 100644 --- a/src/gromacs/onlinehelp/helpwritercontext.cpp +++ b/src/gromacs/onlinehelp/helpwritercontext.cpp @@ -61,7 +61,7 @@ namespace gmx namespace { -//! \addtogroup module_onlinehelp +//! \internal \addtogroup module_onlinehelp //! \{ struct t_sandr diff --git a/src/gromacs/selection/selectioncollection.cpp b/src/gromacs/selection/selectioncollection.cpp index 5b522a1ef4..8500bc1518 100644 --- a/src/gromacs/selection/selectioncollection.cpp +++ b/src/gromacs/selection/selectioncollection.cpp @@ -800,11 +800,4 @@ SelectionCollection::printXvgrInfo(FILE *out, output_env_t oenv) const } } -// static -HelpTopicPointer -SelectionCollection::createDefaultHelpTopic() -{ - return createSelectionHelpTopic(); -} - } // namespace gmx diff --git a/src/gromacs/selection/selectioncollection.h b/src/gromacs/selection/selectioncollection.h index aac15039ee..87f923c7bc 100644 --- a/src/gromacs/selection/selectioncollection.h +++ b/src/gromacs/selection/selectioncollection.h @@ -50,7 +50,6 @@ #include "../legacyheaders/types/oenv.h" -#include "../onlinehelp/helptopicinterface.h" #include "../utility/common.h" #include "selection.h" // For gmx::SelectionList @@ -112,14 +111,6 @@ class SelectionEvaluator; class SelectionCollection { public: - /*! \brief - * Creates a help tree for selections. - * - * \throws std::bad_alloc if out of memory. - * \returns Root topic of the created selection tree. - */ - static HelpTopicPointer createDefaultHelpTopic(); - /*! \brief * Creates an empty selection collection. * diff --git a/src/gromacs/selection/selhelp.cpp b/src/gromacs/selection/selhelp.cpp index e3dd3eeb77..b0dd12f445 100644 --- a/src/gromacs/selection/selhelp.cpp +++ b/src/gromacs/selection/selhelp.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, 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. @@ -615,7 +615,7 @@ void KeywordsHelpTopic::printKeywordList(const HelpWriterContext &context, } // namespace -/*! \cond internal */ +//! \cond libapi */ HelpTopicPointer createSelectionHelpTopic() { CompositeHelpTopicPointer root(new CompositeHelpTopic); diff --git a/src/gromacs/selection/selhelp.h b/src/gromacs/selection/selhelp.h index 42598d7a3b..225434b3f9 100644 --- a/src/gromacs/selection/selhelp.h +++ b/src/gromacs/selection/selhelp.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2014, 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. @@ -32,11 +32,12 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ -/*! \internal \file +/*! \libinternal \file * \brief * Functions for initializing online help for selections. * * \author Teemu Murtola + * \inlibraryapi * \ingroup module_selection */ #ifndef GMX_SELECTION_SELHELP_H @@ -47,8 +48,8 @@ namespace gmx { -/*! \cond internal */ -/*! \internal \brief +//! \cond libapi +/*! \libinternal \brief * Creates a help tree for selections. * * \throws std::bad_alloc if out of memory. diff --git a/src/programs/gmx.cpp b/src/programs/gmx.cpp index 68ff5408e7..a0bcc6fb27 100644 --- a/src/programs/gmx.cpp +++ b/src/programs/gmx.cpp @@ -39,7 +39,7 @@ */ #include "gromacs/commandline/cmdlinemodulemanager.h" #include "gromacs/commandline/cmdlineinit.h" -#include "gromacs/selection/selectioncollection.h" +#include "gromacs/selection/selhelp.h" #include "gromacs/trajectoryanalysis/modules.h" #include "gromacs/utility/exceptions.h" @@ -54,7 +54,7 @@ main(int argc, char *argv[]) gmx::CommandLineModuleManager manager("gmx", &context); registerTrajectoryAnalysisModules(&manager); registerLegacyModules(&manager); - manager.addHelpTopic(gmx::SelectionCollection::createDefaultHelpTopic()); + manager.addHelpTopic(gmx::createSelectionHelpTopic()); int rc = manager.run(argc, argv); gmx::finalizeForCommandLine(); return rc; -- 2.22.0