Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / selection / selectionoptionmanager.h
index 0b9807ac73c15a260f230ffe29367d0fae3844a2..66a075dcafe8901138f90ac77fa3d56102a71984 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 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.
  *
  * GROMACS is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -45,7 +45,8 @@
 
 #include <string>
 
-#include "../utility/common.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/common.h"
 
 namespace gmx
 {
@@ -62,6 +63,8 @@ class SelectionOptionStorage;
  * require actions outside options parsing.
  * It also implements the coupling between SelectionOption and
  * SelectionFileOption.
+ * It needs to be added using Options::addManager() before SelectionOption or
+ * SelectionFileOption options can be added to an Options collection.
  *
  * The main features of this class are:
  *  - convertOptionValue(), which is used to convert string values into
@@ -73,12 +76,10 @@ class SelectionOptionStorage;
  *    parseRequestedFromStdin(), parseRequestedFromFile() or
  *    parseRequstedFromString().
  *
- * \see setManagerForSelectionOptions()
- *
  * \inpublicapi
  * \ingroup module_selection
  */
-class SelectionOptionManager
+class SelectionOptionManager : public OptionManagerInterface
 {
     public:
         /*! \brief
@@ -87,7 +88,7 @@ class SelectionOptionManager
          * \throws  std::bad_alloc if out of memory.
          */
         explicit SelectionOptionManager(SelectionCollection *selections);
-        ~SelectionOptionManager();
+        virtual ~SelectionOptionManager();
 
         /*! \brief
          * Adds a selection option to be managed.
@@ -107,6 +108,8 @@ class SelectionOptionManager
          *
          * \param     storage  Storage object to receive the selections.
          * \param[in] value    Value to convert.
+         * \param[in] bFullValue  If true, the provided selections are the full
+         *      value of the option, and additional checks are performed.
          * \throws    std::bad_alloc if out of memory.
          * \throws    InvalidInputError if the selection string is not valid,
          *      or uses a feature not supported by the option.
@@ -116,7 +119,8 @@ class SelectionOptionManager
          * through any public or library API.
          */
         void convertOptionValue(SelectionOptionStorage *storage,
-                                const std::string      &value);
+                                const std::string      &value,
+                                bool                    bFullValue);
         /*! \brief
          * Adds a selection option for delayed user input.
          *
@@ -206,20 +210,6 @@ class SelectionOptionManager
         friend class SelectionOptionStorage;
 };
 
-/*! \brief
- * Set manager for all selection options.
- *
- * Recursively sets the manager to \p manager for all selection options in
- * \p options.
- * Must be called before value assignment starts for \p options.
- *
- * Does not throw.
- *
- * \inpublicapi
- */
-void setManagerForSelectionOptions(Options                *options,
-                                   SelectionOptionManager *manager);
-
 } // namespace gmx
 
 #endif