Remove selection help from SelectionCollection
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 7 Jul 2014 04:41:26 +0000 (07:41 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Tue, 8 Jul 2014 13:07:30 +0000 (15:07 +0200)
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
src/gromacs/commandline/shellcompletions.h
src/gromacs/onlinehelp.h [deleted file]
src/gromacs/onlinehelp/CMakeLists.txt
src/gromacs/onlinehelp/helptopicinterface.h
src/gromacs/onlinehelp/helpwritercontext.cpp
src/gromacs/selection/selectioncollection.cpp
src/gromacs/selection/selectioncollection.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/selhelp.h
src/programs/gmx.cpp

index 13de5ee37731f3dfd33eb0f30c902e3eeb0c0a52..c7bd01ab359d85347b799473abe79849377a5cd9 100644 (file)
@@ -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
 
index b2f01cfbb8148ff3e393e94f961075dc5da5ed98..b16ec2f5c8110fcab5eb2c2fd3a270355e8c2014 100644 (file)
@@ -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 (file)
index 9a5caf6..0000000
+++ /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 <teemu.murtola@gmail.com>
- */
-/*! \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 <teemu.murtola@gmail.com>
- * \inlibraryapi
- * \ingroup module_onlinehelp
- */
-#ifndef GMX_ONLINEHELP_H
-#define GMX_ONLINEHELP_H
-
-#include "onlinehelp/helptopicinterface.h"
-
-#endif
index a6448783a801e320a773c693849876dd948bbe9d..c34de31cc06950baecba9262bd219fdd62bd2a03 100644 (file)
 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()
index 1c6926369fdceb45174d2515e307494f35e37a2e..e3f0c92d44ef5ba5f22059e0e0614ee9446c76d5 100644 (file)
  * 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 <teemu.murtola@gmail.com>
+ */
+/*! \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
index 649ab7849d96ac0541265b9f2300895db6147576..00e7bd33a9a4a69b2a681b51445496b0717dce57 100644 (file)
@@ -61,7 +61,7 @@ namespace gmx
 namespace
 {
 
-//! \addtogroup module_onlinehelp
+//! \internal \addtogroup module_onlinehelp
 //! \{
 
 struct t_sandr
index 5b522a1ef45fac14430517a509bd80a7944cfacc..8500bc1518af27117a6f3525b0d2640200d4df4d 100644 (file)
@@ -800,11 +800,4 @@ SelectionCollection::printXvgrInfo(FILE *out, output_env_t oenv) const
     }
 }
 
-// static
-HelpTopicPointer
-SelectionCollection::createDefaultHelpTopic()
-{
-    return createSelectionHelpTopic();
-}
-
 } // namespace gmx
index aac15039ee994f849516b4a22ce2ab7cfba9cea5..87f923c7bc99b8e98a714202fe09d8ad2a297afb 100644 (file)
@@ -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.
          *
index e3dd3eeb771d28bd5ea79d5f49a96d54d0733e31..b0dd12f44587989b0407a033cfecece4f250965b 100644 (file)
@@ -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<CommonHelpText>);
index 42598d7a3b7f54dcc4c8242f916e29cad5ce7a97..225434b3f961c30f678ec68d6070977f6361777f 100644 (file)
@@ -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.
  * 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 <teemu.murtola@gmail.com>
+ * \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.
index 68ff5408e7f2c47644ed470b431b4a4c0bda599a..a0bcc6fb270953b6d72e23435101a9ba71f6f907 100644 (file)
@@ -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;